Multiple criteria

Shree1

New Member
Joined
Sep 8, 2014
Messages
31
I have a data set that looks like the below

[TABLE="width: 323"]
<TBODY>[TR]
[TD]MATCH_ID</SPAN>[/TD]
[TD]SUM ID</SPAN>[/TD]
[TD]CP</SPAN>[/TD]
[/TR]
[TR]
[TD="align: right"]473132746</SPAN>[/TD]
[TD="align: right"]698131</SPAN>[/TD]
[TD]A</SPAN>[/TD]
[/TR]
[TR]
[TD="align: right"]473132746</SPAN>[/TD]
[TD="align: right"]459759729</SPAN>[/TD]
[TD]B</SPAN>[/TD]
[/TR]
[TR]
[TD="align: right"]473132746</SPAN>[/TD]
[TD="align: right"]459759732</SPAN>[/TD]
[TD]B</SPAN>[/TD]
[/TR]
[TR]
[TD="align: right"]473132748</SPAN>[/TD]
[TD="align: right"]698153</SPAN>[/TD]
[TD]A</SPAN>[/TD]
[/TR]
[TR]
[TD="align: right"]473132748</SPAN>[/TD]
[TD="align: right"]175466963</SPAN>[/TD]
[TD]B</SPAN>[/TD]
[/TR]
[TR]
[TD="align: right"]473132748</SPAN>[/TD]
[TD="align: right"]175470122</SPAN>[/TD]
[TD]B</SPAN>[/TD]
[/TR]
[TR]
[TD="align: right"]473132752</SPAN>[/TD]
[TD="align: right"]698343</SPAN>[/TD]
[TD]A</SPAN>[/TD]
[/TR]
[TR]
[TD="align: right"]473132752</SPAN>[/TD]
[TD="align: right"]474051970</SPAN>[/TD]
[TD]B</SPAN>[/TD]
[/TR]
[TR]
[TD="align: right"]473132752</SPAN>[/TD]
[TD="align: right"]474052093</SPAN>[/TD]
[TD]B</SPAN>[/TD]
[/TR]
[TR]
[TD="align: right"]473132752</SPAN>[/TD]
[TD="align: right"]474213901</SPAN>[/TD]
[TD]B</SPAN>[/TD]
[/TR]
[TR]
[TD="align: right"]473132766</SPAN>[/TD]
[TD="align: right"]698959</SPAN>[/TD]
[TD]A</SPAN>[/TD]
[/TR]
[TR]
[TD="align: right"]473132766</SPAN>[/TD]
[TD="align: right"]459759728</SPAN>[/TD]
[TD]B</SPAN>[/TD]
[/TR]
[TR]
[TD="align: right"]473132766</SPAN>[/TD]
[TD="align: right"]459759730</SPAN>[/TD]
[TD]B</SPAN>[/TD]
[/TR]
</TBODY><COLGROUP><COL><COL><COL></COLGROUP>[/TABLE]


Basically, every match id should have equal number of As and Bs, that is, match id 473132746 should have 2 As as CP and 2 Bs as CP or one of each.
I want to write a formula that picks out the whether the number of As and Bs per match id are equal or not. I was trying to combine a countfs and match function but not getting anywhere
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
I added 3 more columns for simplicity. Might this be what you want?


Excel 2010
ABCDEF
1MATCH_IDSUM IDCPNumber of A'sNumber of B'sAre they equal?
2473132746698131A12FALSE
3473132746459759729B12FALSE
4473132746459759732B12FALSE
5473132748698153A12FALSE
6473132748175466963B12FALSE
7473132748175470122B12FALSE
8473132752698343A13FALSE
9473132752474051970B13FALSE
10473132752474052093B13FALSE
11473132752474213901B13FALSE
12473132766698959A12FALSE
13473132766459759728B12FALSE
14473132766459759730B12FALSE
Sheet1
Cell Formulas
RangeFormula
D2=COUNTIFS($A$2:$A$14,A2,$C$2:$C$14,"A")
E2=COUNTIFS($A$2:$A$14,A2,$C$2:$C$14,"B")
F2=D2=E2
 
Upvote 0
Shree1,

Welcome to MrExcel.

Perhaps,....
Excel 2007
ABCD
1MATCH_IDSUM IDCP
2473132746698131AFALSE
3473132746459759729BFALSE
4473132746459759732BFALSE
5473132748698153AFALSE
6473132748175466963BFALSE
7473132748175470122BFALSE
8473132752698343ATRUE
9473132752474051970BTRUE
10473132752474052093BTRUE
11473132752474213901ATRUE
12473132766698959AFALSE
13473132766459759728BFALSE
14473132766459759730BFALSE
Sheet1
Cell Formulas
RangeFormula
D2=COUNTIFS($A$2:$A$30,A2,$C$2:$C$30,"A")=COUNTIFS($A$2:$A$30,A2,$C$2:$C$30,"B")


Hope that helps.
 
Upvote 0

Forum statistics

Threads
1,222,239
Messages
6,164,782
Members
451,914
Latest member
mdfariborz

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