View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default How do I count distinct names?

Try something like this:

For a list of values in A1:A10

B1: =SUMPRODUCT((A1:A10<"")/COUNTIF(A1:A10,A1:A10&""))
.....confirmed with ENTER only, or...

B1: =SUM(IF(A1:A10<"",1/COUNTIF(A1:A10,A1:A10)))
.....confirmed with CONTROL+SHIFT+ENTER.


Does that help?

***********
Regards,
Ron

XL2002, WinXP-Pro


"Rona" wrote:

How do you count distinct names in a range? If a name is repeated in that
range, it should only count it as 1 name. For example:

apples, apples, orange, orange, pear, pear, pear, banana

the formula should return 4.

Thanks.