Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 516
Default Count of unique values

I have 2 columns of data, A1:A10 has just numbers eg 123, 456 etc, B1:B10 has
a combination of letters and numbers eg ABC123, DEF456 etc. The data is not
continous within each column (ie there are blank rows within each range).

I need a formula for each range which will count the number of unique values
within each column. I have tried to find solution in similar Q&As but can't
seem to find a solution which will disregard the empty cells and not return a
#DIV/0! result.

Any help would be great. Thanks.
--
Regards
Matt
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,420
Default Count of unique values

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

--
__________________________________
HTH

Bob

"Matt" wrote in message
...
I have 2 columns of data, A1:A10 has just numbers eg 123, 456 etc, B1:B10
has
a combination of letters and numbers eg ABC123, DEF456 etc. The data is
not
continous within each column (ie there are blank rows within each range).

I need a formula for each range which will count the number of unique
values
within each column. I have tried to find solution in similar Q&As but
can't
seem to find a solution which will disregard the empty cells and not
return a
#DIV/0! result.

Any help would be great. Thanks.
--
Regards
Matt



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 516
Default Count of unique values

Thanks Bob

Works great.

--
Regards
Matt


"Bob Phillips" wrote:

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

--
__________________________________
HTH

Bob

"Matt" wrote in message
...
I have 2 columns of data, A1:A10 has just numbers eg 123, 456 etc, B1:B10
has
a combination of letters and numbers eg ABC123, DEF456 etc. The data is
not
continous within each column (ie there are blank rows within each range).

I need a formula for each range which will count the number of unique
values
within each column. I have tried to find solution in similar Q&As but
can't
seem to find a solution which will disregard the empty cells and not
return a
#DIV/0! result.

Any help would be great. Thanks.
--
Regards
Matt




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Count of unique values

Matt

Put this in a cell and array enter. See below for array instructions. Drag 1
column to the right for column B

=SUM(COUNTIF(A1:A10,A1:A10)/IF(NOT(COUNTIF(A1:A10,A1:A10)),1,COUNTIF(A1:A10,A1 :A10))^2)

'This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.

Mike

"Matt" wrote:

I have 2 columns of data, A1:A10 has just numbers eg 123, 456 etc, B1:B10 has
a combination of letters and numbers eg ABC123, DEF456 etc. The data is not
continous within each column (ie there are blank rows within each range).

I need a formula for each range which will count the number of unique values
within each column. I have tried to find solution in similar Q&As but can't
seem to find a solution which will disregard the empty cells and not return a
#DIV/0! result.

Any help would be great. Thanks.
--
Regards
Matt

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 516
Default Count of unique values

Thanks Mike.

Works great.

--
Regards
Matt


"Mike H" wrote:

Matt

Put this in a cell and array enter. See below for array instructions. Drag 1
column to the right for column B

=SUM(COUNTIF(A1:A10,A1:A10)/IF(NOT(COUNTIF(A1:A10,A1:A10)),1,COUNTIF(A1:A10,A1 :A10))^2)

'This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.

Mike

"Matt" wrote:

I have 2 columns of data, A1:A10 has just numbers eg 123, 456 etc, B1:B10 has
a combination of letters and numbers eg ABC123, DEF456 etc. The data is not
continous within each column (ie there are blank rows within each range).

I need a formula for each range which will count the number of unique values
within each column. I have tried to find solution in similar Q&As but can't
seem to find a solution which will disregard the empty cells and not return a
#DIV/0! result.

Any help would be great. Thanks.
--
Regards
Matt



  #6   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Count of unique values

Matt,
Just pondering quietly why you weren't able to get Bob's & my response to
work for you. All 3 responses work ok in light testing over here. Any clues?
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:22,500 Files:370 Subscribers:66
xdemechanik
---
"Matt" wrote:
Thanks Mike.
Works great.


  #7   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Count of unique values

In say, A12:
=SUMPRODUCT(--(A1:A10<""),1/COUNTIF(A1:A10,A1:A10&""))
Copy A12 to B12
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:22,500 Files:370 Subscribers:66
xdemechanik
---
"Matt" wrote:
I have 2 columns of data, A1:A10 has just numbers eg 123, 456 etc, B1:B10 has
a combination of letters and numbers eg ABC123, DEF456 etc. The data is not
continous within each column (ie there are blank rows within each range).

I need a formula for each range which will count the number of unique values
within each column. I have tried to find solution in similar Q&As but can't
seem to find a solution which will disregard the empty cells and not return a
#DIV/0! result.

Any help would be great. Thanks.


  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 516
Default Count of unique values

Thanks Max

Works great. Sorry I didn't get back to you earlier. All 3 answers work
fine.

--
Regards
Matt


"Max" wrote:

In say, A12:
=SUMPRODUCT(--(A1:A10<""),1/COUNTIF(A1:A10,A1:A10&""))
Copy A12 to B12
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:22,500 Files:370 Subscribers:66
xdemechanik
---
"Matt" wrote:
I have 2 columns of data, A1:A10 has just numbers eg 123, 456 etc, B1:B10 has
a combination of letters and numbers eg ABC123, DEF456 etc. The data is not
continous within each column (ie there are blank rows within each range).

I need a formula for each range which will count the number of unique values
within each column. I have tried to find solution in similar Q&As but can't
seem to find a solution which will disregard the empty cells and not return a
#DIV/0! result.

Any help would be great. Thanks.


  #9   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Count of unique values

Welcome, and thanks for a good closure to this thread.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:22,500 Files:370 Subscribers:66
xdemechanik
---
"Matt" wrote in message
...
Thanks Max

Works great. Sorry I didn't get back to you earlier. All 3 answers work
fine.

--
Regards
Matt



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 unique values fsfiligoi Excel Discussion (Misc queries) 5 June 4th 08 08:48 PM
Count Unique Values Averitt Engineer[_2_] Excel Worksheet Functions 17 February 17th 07 09:57 AM
Count unique values Mary Excel Worksheet Functions 3 January 20th 06 08:56 PM
Count of Unique values Richard Excel Worksheet Functions 3 September 27th 05 05:46 AM
Count unique values and create list based on these values vipa2000 Excel Worksheet Functions 7 August 5th 05 01:17 AM


All times are GMT +1. The time now is 07:00 PM.

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

About Us

"It's about Microsoft Excel"