count a certain combination in a sheet

Copper Contributor


I got problems to solve next thing:

I have a sheet, 5000 columns, 7 rows.

Each cell is filled with a number from 1 to 100 (both included).

Each column has 7 unique ordered values (fe 15-33-48-54-61-79-90)

Now my question:

How can I count how many times a given combination is in my sheet? (fe 33-54-79, or 61-90, or 15-48-79-90)

So fe 61-90 can appear in 30 columns

I have in a separate sheet 7 cells to fill in the values i need to find, so i can choose the combinations myself (from A1 to A7)

Thanks in advance

2 Replies



Let's say your data are in A1:GJH7 on Sheet1.

And the values you want to count are on Sheet2 in A1 and down.

Enter the following formula in A10 on Sheet1:


Fill to the right to GJH10.

The formula to count the number of columns that contain the combination is




An alternative could be these formulas. The first formula is in cell C1 in Sheet2 and spills the columns down. The second formula is in cell D1 and returns the count.