How to count unique values?

A

Annie

Is there a way to count the number of unique values (in my case, they
are names) in a column?

Example:
Joe
Joe
Mary
Annie
Annie

Count of unique values = 3

Thanks!
Annie
 
D

Dave Peterson

=SUMPRODUCT((A1:A200<>"")/COUNTIF(A1:A200,A1:A200&""))
will give the count of unique items
 
R

Richard O. Neville

You could do this with the subtotals function. First, make a copy of your
sheet so you won't mess up the original. Then sort by the column containing
the names. Apply subtotals; At every change in..., answer Names (or whatever
is in the column header). Use function...Count; Add subtotal to (some column
with a numeric value).
 
D

Duke Carey

This is an array formula, meaning you commit it with Shift-Ctrl-Enter

=SUMPRODUCT((A1:A100<>"")/COUNTIF(A1:A100,A1:A100&""))
 
A

Annie

Thank you very much for all of your suggestions. I ended up using the
subtotal function and that worked fine. Thank you again for your quick
responses!
 
Top