Count Different Values in a column

  • Thread starter Thread starter KJ MAN
  • Start date Start date
K

KJ MAN

I need to know the number of differing entries in a column.
For Example

Name:
George
Carol
Don
George
Don
Carol
Pat
Sam
George

Should return 5 because there are 5 different names.
 
If the values are in the range A1:A10 then

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

The first part gives 1 for each cell that is not empty. Then divides it
with how many instances there is of this value.
Summing that gives you the "unique count".

The &"" is to avoid 0 and #DIV/0 when a cell is empty.

Ref: http://www.mrexcel.com/archive2/63500/73502.htm

Happy Programming!
- Suranthe
 

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