COUNTIF or SUMPRODUCT

S

SFC Traver

Not sure which way to go on this. I have three columns (Race, Rank, Gender)
and I need to count how many white,sgt,males there are and put it in one cell
in another worksheet in the same book.

Have search the board and everything I've tried has not worked. If you
could help me with this, I can replace what I need.

Race column is D2:D4000
Rank Column is E2:E4000
Gender Column is G2:G4000

Thanks!
Dan
 
T

T. Valko

Try this:

=SUMPRODUCT(--(D2:D4000="white"),--(E2:E4000="sgt"),--(G2:G4000="male"))

Better to use cells to hold the criteria:

A1 = white
B1 = sgt
C1 = male

=SUMPRODUCT(--(D2:D4000=A1),--(E2:E4000=B1),--(G2:G4000=C1))
 
S

SFC Traver

Thanks. It worked. I tried to make it simplier for whomever takes over for me
by assigning names to the cell ranges and I keep getting the #NUM error.

I named the D column "REDCAT", E column "Grade", G column "Gender" and then
named each cell like you recommended (white, black, sgt, ssg, etc).

Then I replaced the formula you sent and it's not working. Can I do this?

=SUMPRODUCT(--(REDCAT=WHITE),--(Gender=M),--(Grade=Jr NCO))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top