How to count unique values?

  • Thread starter Thread starter Annie
  • Start date Start date
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
 
=SUMPRODUCT((A1:A200<>"")/COUNTIF(A1:A200,A1:A200&""))
will give the count of unique items
 
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).
 
This is an array formula, meaning you commit it with Shift-Ctrl-Enter

=SUMPRODUCT((A1:A100<>"")/COUNTIF(A1:A100,A1:A100&""))
 
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!
 

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

Back
Top