Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / September 2005

Tip: Looking for answers? Try searching our database.

Count of Unique values

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Richard - 21 Sep 2005 08:58 GMT
I have a list of values down a column, e.g.

a
a
a
c
c
e
e

etc.

I know I can use advanced filter to get a list of unique values and
then count them, but is there a single function that would achieve
this.

i.e the result for the data above would be 3 (a,c & e)

Rgds
kk - 21 Sep 2005 09:27 GMT
Hi Richard,

Try...

=SUMPRODUCT((YourRange<>"")/COUNTIF(YourRange,YourRange&""))

I have a list of values down a column, e.g.

a
a
a
c
c
e
e

etc.

I know I can use advanced filter to get a list of unique values and
then count them, but is there a single function that would achieve
this.

i.e the result for the data above would be 3 (a,c & e)

Rgds
KL - 21 Sep 2005 09:36 GMT
Hi Richard,

If you have numeric values then:

=SUM(N(FREQUENCY(A1:A10,A1:A10)>0))

If you have text or mixture of text and numeric and no blanks then:

=SUMPRODUCT(1/COUNTIF(A1:A8,A1:A8))

If you have text or mixture of text and numeric and blank cells then:

=SUMPRODUCT(IF(ISNUMBER(1/COUNTIF(A1:A10,A1:A10)),1/COUNTIF(A1:A10,A1:A10)))
This one has to be ARRAY-entered (Ctrl+Shift+Enter, not just Enter). Blanks
are not counted.

Rgards,
KL

>I have a list of values down a column, e.g.
>
[quoted text clipped - 15 lines]
>
> Rgds
Aladin Akyurek - 27 Sep 2005 05:46 GMT
> Hi Richard,
>
[quoted text clipped - 11 lines]
> This one has to be ARRAY-entered (Ctrl+Shift+Enter, not just Enter). Blanks
> are not counted.

The last one won't succeed with formula blanks, while

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

or

{=SUM(IF(A1:A10<>"",1/COUNTIF(A1:A10,A1:A10)))}

will.

BTW, whenever you need filtering with IF, it's better to replace
SumProduct with Sum.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.