count if condition in two columns

M

MusicMan

I have tab which lists employees in col A10:A110. I need formula to count
from another list the occurances of emp X in a list on another tab where the
second col is "y"

I could not get countif(and(sheet2!C10:C500,=A10),(sheet2!D10:D500,"y")) to
work but I think you see what I am trying for. I want to copy this formula
down Col b for all 100 employees. Using Dcount I don't think is appropriate
cause I don't want to set up 100+ criteria ranges. I need the criteria in
the formula.

Hope this is clear.
 
J

Jacob Skaria

When you have multiple criteria use SUMPRODUCT()

=SUMPRODUCT((A1:A10=criteria1)*(B1:B10=criteria2))
=SUMPRODUCT((A1:A10=F1)*(B1:B10=F2))

=SUMPRODUCT((A1:A10=criteria1)*(B1:B10=criteria2)*(C1:C10=criteria3))
'Wtih cells F1,F2,F3 holding the criteria
=SUMPRODUCT((A1:A10=F1)*(B1:B10=F2)*(C1:C10=F3))

If you are using Excel 2007 check out help on COUNTIFS()

If this post helps click Yes
 
J

Jacob Skaria

'missed the equal sign

=sumproduct((sheet2!C10:C500=A10)*(sheet2!D10:D500="y"))

If this post helps click Yes
 

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