Count all the values from 1 table if it's true that they exist in a nother table

fructine

New Member
Joined
Jan 21, 2016
Messages
14
Hi guys,

I need to figure out how to create 1 single formula that will allow me to count all the values given a couple of criteria, only if they exist in another sheet's table.
Here is what it looks like:

Sheet A: Total registered
Team ID Location
Anne 10 France
Mark 20 France
John 11 Italy
Rose 21 Italy
Peter 12 Germany
Hans 22 Germany
Elena 23 USA

Sheet B: Did not attend
Name ID Location
Peter 12 Germany
Alice 13 USA
Elena 23 USA

Need to solve in Sheet C: Failed attendance by location (ONLY if registered)
Location Failed Attendance
France ???
Italy ???
Germany ???
USA ???

How would you solve for this? Again I am looking for a single formula. I have come up with a solution that requires creating another table but I'm hoping to do without that.

Thanks
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
You could use a countif,
assuming on sheet C "France is in A2, something like

=countif(sheetB!:C:C,A2)

In B2 copied down
 
Upvote 0
You could use a countif,
assuming on sheet C "France is in A2, something like

=countif(sheetB!:C:C,A2)

In B2 copied down

I forgot to add the cell numbers ... sorry :)
The issue with this formula is that if we count for example how many from USA did not attend, it would return the value "2", which would be wrong because I only want to count the ones who 1) did not attend and 2) were registered. So the correct answer should be "1" because Alice did not attend but she did not register.
Any suggestion?
 
Upvote 0
Maybe:

Book4
ABCDEFGHIJ
1TeamIDLocationNameIDLocationLocationFailed Attendance
2Anne10FrancePeter12GermanyFrance0
3Mark20FranceAlice13USAItaly0
4John11ItalyElena23USAGermany1
5Rose21ItalyUSA1
6Peter12Germany
7Hans22Germany
8Elena23USA
9
Sheet5
Cell Formulas
RangeFormula
J2:J5J2=SUMPRODUCT(--($G$2:$G$10=I2),--(COUNTIFS($B$2:$B$20,$F$2:$F$10,$C$2:$C$20,I2)>0))
 
Upvote 0
Maybe:

Book4
ABCDEFGHIJ
1TeamIDLocationNameIDLocationLocationFailed Attendance
2Anne10FrancePeter12GermanyFrance0
3Mark20FranceAlice13USAItaly0
4John11ItalyElena23USAGermany1
5Rose21ItalyUSA1
6Peter12Germany
7Hans22Germany
8Elena23USA
9
Sheet5
Cell Formulas
RangeFormula
J2:J5J2=SUMPRODUCT(--($G$2:$G$10=I2),--(COUNTIFS($B$2:$B$20,$F$2:$F$10,$C$2:$C$20,I2)>0))
This works great!! Thanks.
 
Upvote 0

Forum statistics

Threads
1,215,006
Messages
6,122,666
Members
449,091
Latest member
peppernaut

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