PDA

View Full Version : Solved: Count if two criteria meet requirement



john3j
03-19-2009, 08:30 AM
Hey guys, I am trying to count some stuff. I have the Month of October in A8 and in B8 I would like to count the number of of instances where the following criteria are met:

E29:E1000="Yes"
F29:F1000 equals any date in the month of 10/2008

I guess if I was just gonna write something logically I would put:

B8 =COUNTIF((E29:E1000, "Yes"),F29:F1000, Between 10/1/2008 and 10/31/2008))

I just dont know how to do the date part. I would appreciate the help. Thanks!

Bob Phillips
03-19-2009, 08:33 AM
=SUMPRODUCT(--(E29:E1000="Yes"),--(TEXT(F29:F1000,"mmmyyyy")="Oct2008"))

GTO
03-19-2009, 09:32 AM
I have the Month of October in A8

F29:F1000 equals any date in the month of 10/2008

B8 =COUNTIF((E29:E1000, "Yes"),F29:F1000, Between 10/1/2008 and 10/31/2008))

Greetings John,

Presuming a date that falls in the month of the year in A8 is in Fxx and Exx equals 'yes', this may work:

B8: =SUMPRODUCT(--(E29:E1000="Yes"),--(F29:F1000>=DATEVALUE(MONTH(A8)&"/01/"&YEAR(A8))),--(F29:F1000<=DATEVALUE(MONTH(A8)&"/31/"&YEAR(A8))))

Hope this helps,

Mark

john3j
03-19-2009, 09:37 AM
Works great man thanks!