Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Excel formula to count unique text values in a column not working as expected


UPDATE: I just realized that this is only counting UNIQUE entries as in there is only 1, whereas I am looking to count all UNIQUE entries whether it be 1 or duplicated.

The term is DISTINCT that I needed.


What is incorrect about the formula for counting unique text values?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

All examples I have found state this is how to calculate the total unique entries in a spreadsheet.

In this example you can see it is NOT calculating correctly for the formula.

=SUM(IF(ISTEXT(A1:A8)*COUNTIF(A1:A8,A1:A8)=1,1,0))

Yes, I am pressing CTRL + SHIFT + ENTER

6 should be the count

>Solution :

Why don’t you use the UNIQUE() function for that?
This should work:

=COUNTA(UNIQUE(A1:A8))

If you don’t have the UNIQUE() function, you might opt for this:

=SUM(1/COUNTIF(A$1:A$8,A1:A8))

It’s in fact quite silly: when you have a letter once, you get 1. When you have it twice, you get 2, …, by dividing one by that number and adding all of them, you get the number you’re looking for.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading