View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Counting Distinct Values

one way:

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

(adjust the range to match, but don't use the whole column)

giantwolf wrote:

Hi,

Hope you all had a good Christmas. Is there a way to count the number
of distinct values that appear in a column either by a formula or
macro?

ie. in this list it would return the value 4 as orange appears twice so
should only be counted once.

apple
orange
pear
orange
grape

Thanks in advance,

GW

--
giantwolf
------------------------------------------------------------------------
giantwolf's Profile: http://www.excelforum.com/member.php...o&userid=24718
View this thread: http://www.excelforum.com/showthread...hreadid=496644


--

Dave Peterson