View Single Post
  #4   Report Post  
Aladin Akyurek
 
Posts: n/a
Default

KL wrote:
Hi Richard,

If you have numeric values then:

=SUM(N(FREQUENCY(A1:A10,A1:A10)0))

If you have text or mixture of text and numeric and no blanks then:

=SUMPRODUCT(1/COUNTIF(A1:A8,A1:A8))

If you have text or mixture of text and numeric and blank cells then:

=SUMPRODUCT(IF(ISNUMBER(1/COUNTIF(A1:A10,A1:A10)),1/COUNTIF(A1:A10,A1:A10)))
This one has to be ARRAY-entered (Ctrl+Shift+Enter, not just Enter). Blanks
are not counted.


The last one won't succeed with formula blanks, while

=SUMPRODUCT((A1:A10<"")/COUNTIF(A1:A10,A1:A10&""))

or

{=SUM(IF(A1:A10<"",1/COUNTIF(A1:A10,A1:A10)))}

will.


BTW, whenever you need filtering with IF, it's better to replace
SumProduct with Sum.