Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default SUMPRODUCT to count items with duplicates where another column contains two defined items

Ok, I think this is a SUMPRODUCT delima.

A B C D
z 1
q 1
z 5
w 0
z 2
q 2

I'd like to get a count of duplicate values in column A that have both 1 and
2 values in column C. For example, "z" shows up three times in column A.
Respectively "1" and "2" show up. That would count as one. Also, "q"
exists twice in column A. Again respectively "1" and "2" shows up. That
would also count as one. So the result for this formula would be 2 for my
example. However, my data is much more.

Any ideas.

Note, the values in column A are unknown. The number of times each value
may show could be as many as 4.


Thanks,
Paul

--



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default SUMPRODUCT to count items with duplicates where another column con

=SUM(N(FREQUENCY(IF((C1:C6=1)+(C1:C6=2),MATCH(A1:A 6,A1:A6,0)),MATCH(A1:A6,A1:A6,0))0))

ctrl+shift+enter, not just enter


"PCLIVE" wrote:

Ok, I think this is a SUMPRODUCT delima.

A B C D
z 1
q 1
z 5
w 0
z 2
q 2

I'd like to get a count of duplicate values in column A that have both 1 and
2 values in column C. For example, "z" shows up three times in column A.
Respectively "1" and "2" show up. That would count as one. Also, "q"
exists twice in column A. Again respectively "1" and "2" shows up. That
would also count as one. So the result for this formula would be 2 for my
example. However, my data is much more.

Any ideas.

Note, the values in column A are unknown. The number of times each value
may show could be as many as 4.


Thanks,
Paul

--




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default SUMPRODUCT to count items with duplicates where another column con

Probably a shorter way, but I'll take a shot at it:

=SUMPRODUCT(--(MMULT(--ISNUMBER(MATCH(A1:A6&{1,2},A1:A6&C1:C6,0)),{1;1}) 1),--(MATCH(A1:A6,A1:A6,0)=ROW(A1:A6)-MIN(ROW(A1:A6))+1))



"PCLIVE" wrote:

Ok, I think this is a SUMPRODUCT delima.

A B C D
z 1
q 1
z 5
w 0
z 2
q 2

I'd like to get a count of duplicate values in column A that have both 1 and
2 values in column C. For example, "z" shows up three times in column A.
Respectively "1" and "2" show up. That would count as one. Also, "q"
exists twice in column A. Again respectively "1" and "2" shows up. That
would also count as one. So the result for this formula would be 2 for my
example. However, my data is much more.

Any ideas.

Note, the values in column A are unknown. The number of times each value
may show could be as many as 4.


Thanks,
Paul

--




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default SUMPRODUCT to count items with duplicates where another column

I think the OP wants a count of items that appear with both a 1 and 2 in Col
C. The results I get count how many items have either a 1 or 2 in Col C.

For example, by changing the 0 for "w" to either a 1 or 2 it will get counted.


"Teethless mama" wrote:

=SUM(N(FREQUENCY(IF((C1:C6=1)+(C1:C6=2),MATCH(A1:A 6,A1:A6,0)),MATCH(A1:A6,A1:A6,0))0))

ctrl+shift+enter, not just enter


"PCLIVE" wrote:

Ok, I think this is a SUMPRODUCT delima.

A B C D
z 1
q 1
z 5
w 0
z 2
q 2

I'd like to get a count of duplicate values in column A that have both 1 and
2 values in column C. For example, "z" shows up three times in column A.
Respectively "1" and "2" show up. That would count as one. Also, "q"
exists twice in column A. Again respectively "1" and "2" shows up. That
would also count as one. So the result for this formula would be 2 for my
example. However, my data is much more.

Any ideas.

Note, the values in column A are unknown. The number of times each value
may show could be as many as 4.


Thanks,
Paul

--




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default SUMPRODUCT to count items with duplicates where another column contains two defined items

If the values in C are actually numbers, then I think this will work for
you...

=SUMPRODUCT((A1:A100=F1)*(C1:C100={1,2}))

If, on the other hand, the values in C are text, then try this instead....

=SUMPRODUCT((A1:A100=F1)*(C1:C100={"1","2"}))

And if the data in C could be either numbers or text, then try it this
way...

=SUMPRODUCT((A1:A100=F1)*(C1:C100={1,2,"1","2"}))

Of course, change the range to encompass the maximum row number that might
one day contain data.

Rick


"PCLIVE" wrote in message
...
Ok, I think this is a SUMPRODUCT delima.

A B C D
z 1
q 1
z 5
w 0
z 2
q 2

I'd like to get a count of duplicate values in column A that have both 1
and 2 values in column C. For example, "z" shows up three times in column
A. Respectively "1" and "2" show up. That would count as one. Also, "q"
exists twice in column A. Again respectively "1" and "2" shows up. That
would also count as one. So the result for this formula would be 2 for my
example. However, my data is much more.

Any ideas.

Note, the values in column A are unknown. The number of times each value
may show could be as many as 4.


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
How do I set up a formula to count only unique items in a column? LYLERR Excel Worksheet Functions 3 September 25th 09 12:53 AM
How do I sort - and count - items in a column? VanS Excel Discussion (Misc queries) 1 December 21st 06 06:07 AM
How do I count differert items in a column only if the date in an. Andy D Excel Worksheet Functions 6 April 5th 06 01:29 PM
Count number of items in one column that have a value in another? onthefritz Excel Worksheet Functions 5 December 10th 05 04:19 PM
Count number of unique items in a column that contains duplicates Steembeem Excel Worksheet Functions 3 February 2nd 05 12:51 AM


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