View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default count if condition in two columns

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
---------------
Jacob Skaria


"MusicMan" wrote:

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.