Count & Compare - help!

SEL

New Member
Joined
Nov 16, 2005
Messages
2
Hi, I need to count the number of male students and the number of female students who are predicted to get the same grade level.

Column A = Student name
Column B = Male or Female (M/F)
Column C = Predicted Grade (single number e.g 2)
Column D = Target Grade (single number e.g 3)

A1 = John
B1 = M
C1 = 2
D1 = 3

A2 = Mary
B2 = F
C2 = 2
D2 = 3

G1 = Female Predicted Grade 2
H1 = Male Predicted Grade 2
G2 = Female Predicted Grade 3
H2 = Male Predicted Grade 3

How do I tell Excel to compare two cells and if it meets a requirement to then count and then put in another cell?

E.g If B2 = F and C2 = 2 then count and put in G1 and then continue checking & comparing the rest of column B & C.

Can anyone help me?!?!
Thanks, Sandra
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Something like this?
Book1
ABCDEFGH
1StudentM/FPred. GradeTarg. GradePredicted 2Predicted 3
2JohnM23Female20
3MaryF23Male10
4LizF23
Sheet1


G1 contains =SUMPRODUCT(--($B$2:$B$101="F"),--($C$2:$C$101=2))
G2 contains =SUMPRODUCT(--($B$2:$B$101="M"),--($C$2:$C$101=2))
H1 contains =SUMPRODUCT(--($B$2:$B$101="F"),--($C$2:$C$101=3))
H2 contains =SUMPRODUCT(--($B$2:$B$101="M"),--($C$2:$C$101=3))
 
Upvote 0
Thank you :)

Wow! Thanks you are a genius. I have put this in the spreadsheet and told the teacher, there is one happier teacher in the world so maybe her students will have an easy afternoon!
 
Upvote 0

Forum statistics

Threads
1,215,065
Messages
6,122,945
Members
449,095
Latest member
nmaske

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