Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Richard
 
Posts: n/a
Default Count of Unique values

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

  #2   Report Post  
kk
 
Posts: n/a
Default

Hi Richard,

Try...

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




"Richard" wrote in message
oups.com...
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


  #3   Report Post  
KL
 
Posts: n/a
Default

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




"Richard" wrote in message
oups.com...
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



  #4   Report Post  
Aladin Akyurek
 
Posts: n/a
Default

KL wrote:
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.


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.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count of unique entries slang Excel Discussion (Misc queries) 4 July 3rd 05 06:45 AM
how to count unique entries with multiple condition Michael Excel Worksheet Functions 6 June 29th 05 12:38 PM
Count Distinct Values? bill_morgan Excel Worksheet Functions 7 April 27th 05 02:12 AM
AutoFilter lists unique values R.J.H. Excel Discussion (Misc queries) 3 April 19th 05 08:53 PM
Counting unique values + frequency Mike Ferguson Excel Worksheet Functions 3 November 24th 04 07:31 AM


All times are GMT +1. The time now is 09:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"