CountIF..

P

Pietro

How can i achive the following equation:

=COUNTIF(H:H,"=Peter")*And(J:J="03/2007")
Note that the column J is formatted as mm/yyyy
Regards
 
D

Dave Peterson

If column J contains dates formatted as mm/yyyy, you could use:

=sumproduct(--(h1:h99="peter"),--(text(j1:j99,"yyyymm")="200703"))

Adjust the ranges to match--but you can't use whole columns (except in xl2007).

=sumproduct() likes to work with numbers. The -- stuff changes trues and falses
to 1's and 0's.

Bob Phillips explains =sumproduct() in much more detail here:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

And J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html
 
T

Teethless mama

XL2007 only

=COUNTIFS(H:H,"Peter",J:J,">="&DATE(2007,3,1),J:J,"<="&DATE(2007,3,31))
 
Top