Hi,
Here are modifications to your recieved suggestions:
=SUMPRODUCT(--(MONTH(A1:A59)=1),B1:B59)
=SUMPRODUCT(--(TEXT(A1:A59,"m")="1"),B1:B59)
1. Although it probably doesn't make any difference with your data, using
the -- handles a number of issues that can come up.
2. If you really want to base the sum only on month and not month and year
then the second formula usable.
3. If you really want the month and the year then you would need to modify
the first formula to something like:
=SUMPRODUCT(--(MONTH(A1:A59)=1),--(YEAR(A1:A59)=2009),B1:B59)
or the shorter (but more problematic) form
=SUMPRODUCT((MONTH(A1:A59)=1)*(YEAR(A1:A59)=2009)*B1:B59)
Instead of 1 and 2009 in the formulas you should use cell references. If
you want to use month text such as Jan then the second formula converts
easily to
=SUMPRODUCT(--(TEXT(A1:A59,"mmm")=D1),B1:B59)
where D1 contains Jan
The other formulas can use text references also for example,
=SUMPRODUCT(--(TEXT(A1:A59,"mmm")="Jan"),--(YEAR(A1:A59)=2009),B1:B59)