Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PA PA is offline
external usenet poster
 
Posts: 101
Default Count, ignoring duplicates

I have a column with many duplicates. I need to get a count of each
individual record, ignoring the dupes so that
x
x
y
z
z
z
would yield a count of three. There are many more, spanning from G2:G9075.
Thanks
Paul
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Count, ignoring duplicates

=SUMPRODUCT((G2:G9075<"")/COUNTIF(G2:G9075,G2:G9075&""))
--
Gary''s Student - gsnu200815
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 747
Default Count, ignoring duplicates

try this

=SUM(1/COUNTIF(A2:A7,A2:A7)) ( use ctrl + shift + enter )


On Nov 24, 6:29*pm, PA wrote:
I have a column with many duplicates. *I need to get a count of each
individual record, ignoring the dupes so that
x
x
y
z
z
z
would yield a count of three. *There are many more, spanning from G2:G9075.
Thanks
Paul


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PA PA is offline
external usenet poster
 
Posts: 101
Default Count, ignoring duplicates

Very cool, thanks.
If you have an extra moment, could you explain this. That would be a great
help as I am attempting to master the very versitile Sumproduct function, and
have made strides, but obviously still need to study further.

Thank you

"Gary''s Student" wrote:

=SUMPRODUCT((G2:G9075<"")/COUNTIF(G2:G9075,G2:G9075&""))
--
Gary''s Student - gsnu200815

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PA PA is offline
external usenet poster
 
Posts: 101
Default Count, ignoring duplicates

That works as well, thank you

"muddan madhu" wrote:

try this

=SUM(1/COUNTIF(A2:A7,A2:A7)) ( use ctrl + shift + enter )


On Nov 24, 6:29 pm, PA wrote:
I have a column with many duplicates. I need to get a count of each
individual record, ignoring the dupes so that
x
x
y
z
z
z
would yield a count of three. There are many more, spanning from G2:G9075.
Thanks
Paul





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Count, ignoring duplicates

Your formula will fail if there is a blank cell in the range


"muddan madhu" wrote:

try this

=SUM(1/COUNTIF(A2:A7,A2:A7)) ( use ctrl + shift + enter )


On Nov 24, 6:29 pm, PA wrote:
I have a column with many duplicates. I need to get a count of each
individual record, ignoring the dupes so that
x
x
y
z
z
z
would yield a count of three. There are many more, spanning from G2:G9075.
Thanks
Paul



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PA PA is offline
external usenet poster
 
Posts: 101
Default Count, ignoring duplicates

I hadnt noticed that, since I have no blanks in my field, but it certainly
could be a problem.

"Teethless mama" wrote:

Your formula will fail if there is a blank cell in the range


"muddan madhu" wrote:

try this

=SUM(1/COUNTIF(A2:A7,A2:A7)) ( use ctrl + shift + enter )


On Nov 24, 6:29 pm, PA wrote:
I have a column with many duplicates. I need to get a count of each
individual record, ignoring the dupes so that
x
x
y
z
z
z
would yield a count of three. There are many more, spanning from G2:G9075.
Thanks
Paul



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default Count, ignoring duplicates

Hi,

If the range contained only numbers you could use this

=SUMPRODUCT(--(FREQUENCY(B1:B10,B1:B10)0))

Regarding how the two previous formulas work sustituting a smaller range:

COUNTIF(B1:B10,B1:B10&"") This portion of the formula counts how many time
each item in the range B1:B10 appears in the range B1:B10. It might return
something like this
{4;5;4;5;4;5;1;5;4;5}
If somethng is repeated 5 times there are 5 fives listed. If there are 5
fives then 1 unique items was found, if there were 10 fives that would mean 2
unique items had been found. If a 1 appears it means an item was only found
once. If there are 10 1's there were ten uniques items that appeared only
once.

The B1:B10<"" portion is just checking to see if the cells are not blank,
but it return something like
{TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;FALSE;TRUE;TRUE;TRU E}

Now when you divide (or add, subtract, multiply) a number into a TRUE Excel
converts the TRUE to 1, similarly a FALSE becomes 0. So in effect, think of
this as

{1;1;1;1;1;1;0;1;1;1}

Together this is

{1;1;1;1;1;1;0;1;1;1}/{4;5;4;5;4;5;1;5;4;5}

Which returns

{0.25;0.2;0.25;0.2;0.25;0.2;0;0.2;0.25;0.2}

Notice if an item appeared 5 times it carries a weight of .2, if it appeared
twice it has a weight of .5. If you add 5 .2's you get 1, if you add 2
..5's you get 1.
Sum this up and you have the number of unique items.

If this helps, please click the Yes button

Cheers,
Shane Devenshire

"PA" wrote:

I have a column with many duplicates. I need to get a count of each
individual record, ignoring the dupes so that
x
x
y
z
z
z
would yield a count of three. There are many more, spanning from G2:G9075.
Thanks
Paul

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
counting values ignoring duplicates matt3542 Excel Worksheet Functions 12 June 23rd 09 03:10 AM
Filtering out duplicates while ignoring 1 row Allie Excel Discussion (Misc queries) 0 September 17th 08 03:14 PM
Count Employee Work Time - Don't Count Duplicates J Excel Worksheet Functions 3 May 1st 07 10:47 PM
Counting Names in a Column, Ignoring Duplicates Bruce Excel Discussion (Misc queries) 8 March 18th 07 01:01 PM
How do I do count calculations ignoring duplicate values Robin Faulkner Excel Discussion (Misc queries) 1 March 31st 05 03:01 PM


All times are GMT +1. The time now is 03:52 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"