ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   CountIF.. (https://www.excelbanter.com/excel-discussion-misc-queries/134301-countif.html)

Pietro

CountIF..
 
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

Dave Peterson

CountIF..
 
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 he
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

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

Pietro wrote:

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


--

Dave Peterson

Teethless mama

CountIF..
 
XL2007 only

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


"Pietro" wrote:

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



All times are GMT +1. The time now is 12:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com