Excel – Count occurrences of values or unique values in a data range

excelexcel-formula

There's a formula that is so useful to me on http://office.microsoft.com/en-us/excel-help/count-occurrences-of-values-or-unique-values-in-a-data-range-HP003056118.aspx

It's this:

=SUM(IF(FREQUENCY(MATCH(B2:B10,B2:B10,0),MATCH(B2:B10,B2:B10,0))>0,1))

Which is described on its site as:
"Count the number of unique text and number values in cells B2:B10 (which must not contain blank cells)"

My problem is I need it to allow for blank cells interspersed in the range, but just not count those.

Thank you for any help.

Best Answer

But on the linked page there is the formula:

=SUM(IF(FREQUENCY(IF(LEN(A2:A10)>0,MATCH(A2:A10,A2:A10,0),""), IF(LEN(A2:A10)>0,MATCH(A2:A10,A2:A10,0),""))>0,1))   

which is described as:

Count the number of unique text and number values in cells A2:A10 , but do not count blank cells or text values (6)

what is wrong with that one? It does allow to have blanks?

Related Topic