Counting the number of unique values within a range

S

SiH23

I would be most grateful if someone could offer me some help.

I need to count the number of unique values within a column range. Each
value consists of a series of alpha and numberical characters.

I have used the formula below but it keeps crashing my spreadsheet:

=SUMPRODUCT((1/COUNTIF(A1:A5,A1:A5&"")))

Any help or advice would be greatly appreciated.
 
S

Sean Timmons

Not sure why it would crash, but you do have an extra ) at the end. It worked
fine for me...
 
B

Bernard Liengme

There is nothing wrong with the formula - it worked on my worksheet
Save you file, reopen and try again
It this fails I suspect a corrupt file
best wishes
 
S

SiH23

Many thanks for all your help - I forgot to say that some of the cells within
the column are blank. Do I need to alter the formula in anyway? I suspect
this maybe why I am having problems.
 
S

SiH23

Many thanks for all your help - I forgot to say that some of the cells within
the column are blank. Do I need to alter the formula in anyway? I suspect
this maybe why I am having problems.
 
T

T. Valko

Try it like this:

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

About you file crashing...

That formula is very calculation intensive. If your real range is "large"
(>1000 rows) it will be slow to calculate. If your range is really just 5
rows then you should have no problem.
 

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

Top