Distinct Value With Countif

S

spalmarez

Hi,
I am looking for help with distinct values using countif. This is
what I have so far. Please help.

A B
C
01/03/05 01/18/04 =Countif(A1:A14,"<="&B2) which equals 13 but I
want distinct values, which my value I want is 12
01/04/05
01/04/05
01/05/05
01/06/05
01/07/05
01/10/05
01/11/05
01/12/05
01/13/05
01/14/05
01/17/05
01/18/05
01/19/05
 
A

Aladin Akyurek

=SUM(--(FREQUENCY(IF(A2:A15<=B2,MATCH(A2:A15,A2:A15,0)),ROW(INDIRECT("1:"&ROWS(A2:A15)))-1)>0))

which you need to confirm with control+shift+enter instead of just wit
enter.
 
H

Harlan Grove

Aladin Akyurek said:
=SUM(--(FREQUENCY(IF(A2:A15<=B2,MATCH(A2:A15,A2:A15,0)),
ROW(INDIRECT("1:"&ROWS(A2:A15)))-1)>0))
....

=SUMPRODUCT((A2:A15<=B2)/COUNTIF(A2:A15,A2:A15))

may be more efficient, and it doesn't have to be entered as an array
formula.
 
A

Aladin Akyurek

Harlan said:
....

=SUMPRODUCT((A2:A15<=B2)/COUNTIF(A2:A15,A2:A15))

may be more efficient, and it doesn't have to be entered as an array
formula.

Yeah. As long as the same range is involved, the formula should work,
something I tend to forget.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top