counting unique cases which meet two conditions

The Grim Discovery

Board Regular
Joined
Jan 23, 2015
Messages
241
Office Version
  1. 365
Platform
  1. Windows
A
B
C
D
E
F
1
Team
Name
Rating
Man of Match
2
United
Smith
10
Yes
3
City
Brown
9
Yes
4
United
Robinson
10
Yes

5
United
Smith
10
Yes
6
City
Brown
8
No
7
United
Smith
9
yes

<tbody>
</tbody>

Excel folk

Once again I turn to your wisdom in my hour of need.
The table above replicates the issue I'm having trying to count uniquely occurring instances.

For instance I need to be able to count the number of times that the team called 'United' (Col A) had a player who scored a rating of 10 (col C) & was also Man of the Match (col D). But I only want to count unique cases. So for United this should return a total of 2 as Smith and Robinson both meet those criteria (albeit Smith does twice).

I've recently had support here from user: Domenic on frequency syntax which has been invaluable to me but I cant stretch the logic to fit the case here. I've tried concatenating the data but it hasn't helped. It's the unique bit that does for me as the first part is evidently countifs.

Thanks in advance
 
Last edited:

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Hello,

With your data located in range A1:D7

you could test following Array Formula

Code:
=SUM(IF(FREQUENCY(IF($B$2:$B$7<>"",IF($D$2:$D$7="Yes",IF($A$2:$A$7<="United",IF($C$2:$C$7=10,MATCH("~"&$B$2:$B$7,$B$2:$B$7&"",0))))),ROW($B$2:$B$7)-ROW($B$2)+1),1))

Hope this will help
 
Upvote 0
Cheers James - that absolutely nailed it. There's no way I'd ever have got there. Brilliant.
If you don't mind what's the tilde doing after the MATCH function - that's new to me?
 
Upvote 0
Actually James

I'm finding that the A2:A7 part of the formula appears to be ignoring the name ie. 'United' - thought I might be able to work this out myself. I was wrong...
 
Upvote 0
Hello,

Sorry for the typo ... you should remove the sign ' lower than ' and keep th equal sign ...

Code:
[COLOR=#333333]=SUM(IF(FREQUENCY(IF($B$2:$B$7<>"",IF($D$2:$D$7="Yes",IF($A$2:$A$7="United",IF($C$2:$C$7=10,MATCH("~"&$B$2:$B$7,$B$2:$B$7&"",0))))),ROW($B$2:$B$7)-ROW($B$2)+1),1))[/COLOR]
 
Upvote 0

Forum statistics

Threads
1,214,605
Messages
6,120,473
Members
448,967
Latest member
visheshkotha

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