Although one could possibly tackle this with a spreadsheet or vba, I think it is very well suited to a database solution.

If we transposed the decision table in the link that you provided, into a database table, it might look like this:

decision_table.jpg

You could then query the table as follows

Test Gender condition:
decision_sql1.JPG
This will return records that are identical in every way, except for Gender. If the count of Gender in the aggregated record is equal to the maximum possible count of the gender condition, ie. 2, then we can generalise <count> records into one.

Test City Dweller condition:
decision_sql2.JPG
As for Gender, we need to test for a count of 2.

Test Age condition:
decision_sql3.JPG
Here there are 3 possibilities, so we can only generalise a set of rules if count = 3.