Countifs of appearance within the same Groups listed in a column

dongjip

New Member
Joined
Jul 6, 2016
Messages
4
Hi I am new here. I am wondering how to do countifs with different arrays but also counting by reference to groups within a column. For example in the table below, you will see Column A, there are four groups. How do I count the number of times in which John and Elaine appear in the same group and John ranks 1. In the example, the number of counts should be 2. Do I need VBA for this? My spreadsheets have about 400 groups.

Thanks!
DJ

Excel Workbook
ABC
1GroupNameRank
21John1
31Pearce2
41Douglas3
51Elaine4
61Tim6
72John1
82Tim2
92Pearce3
102Elaine4
112Oliver5
123Tim1
133John2
143Oliver3
153Elaine4
163Pearce5
174John1
184Pearce2
194Tim3
204Toby4
Sheet1
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Perhaps = sumproduct((a2:a20=1)*(b2:b20="John"))

A Pivot Table might also help in this case
 
Upvote 0
Thanks for the quick reply. I have not explained clearly. What i needed to count is that out of the four groups in Column A, there are only three groups in which John and Elaine are within the same Group and out of those three groups, John has ranked 1 twice. My problem is I do not not know how to copy the counting for each Group in Column A.
 
Upvote 0
Shouldn't the count 3, not 3, as john and elaine appear together in the 3 different groups together, i.e. group 1, 2, and 3?
 
Upvote 0
Thanks Aladin, The count should be 2 because although they are in the same group for 3 groups, John ranked "1" in only two of them (in column c).
DJ
 
Upvote 0
Shouldn't the count 3, not 3, as john and elaine appear together in the 3 different groups together, i.e. group 1, 2, and 3?

Thanks Aladin, The count should be 2 because although they are in the same group for 3 groups, John ranked "1" in only two of them (in column c).
DJ

Right...

Control+shift+enter, not just enter:

=SUM(IF(ISNUMBER(MATCH(IF($B$2:$B$20=E1,IF($C$2:$C$20=G1,$A$2:$A$20)),IF($B$2:$B$20=F1,$A$2:$A$20,"#"),0)),1))

where E1 = john, F1 = elaine, and G1 = 1.
 
Upvote 0

Forum statistics

Threads
1,215,148
Messages
6,123,305
Members
449,095
Latest member
Chestertim

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top