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
 

Some videos you may like

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

NBVC

Well-known Member
Joined
Aug 31, 2005
Messages
5,828
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))
 

SEL

New Member
Joined
Nov 16, 2005
Messages
2
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!
 

Watch MrExcel Video

Forum statistics

Threads
1,119,002
Messages
5,575,499
Members
412,670
Latest member
Khin Zaw Htwe
Top