sumif for months and year

K

Kevin

a b c d e
-----------------------------------------------------------------------------
1| 13-Nov-06 20-Nov-06 27-Nov-06 4-Dec-06 11-Dec-06
2| 1 2 3 4 5
3|
4| November, 06
5| 0

I need cell a5 to sum a2:e2 if the month and year on a1:e1 match a4.
I tried =SUMIF(a1:e1,"*Nov*",a2:e2)
and =SUMPRODUCT(--(a1:e1=DATE(YEAR(a4),MONTH(a4),b2:e2)))

Any suggestions?
 
P

Peo Sjoblom

=SUMPRODUCT(--(YEAR(A1:E1)=YEAR(A4)),--(MONTH(A1:E1)=MONTH(A4)),A2:E2)


note that you shouldn't have text in A4, it needs to be a date although you
can custom format is as

mmmm, yy



--


Regards,


Peo Sjoblom
 
K

Kevin

Wheeewww, that works!! Thanks so much

Peo Sjoblom said:
=SUMPRODUCT(--(YEAR(A1:E1)=YEAR(A4)),--(MONTH(A1:E1)=MONTH(A4)),A2:E2)


note that you shouldn't have text in A4, it needs to be a date although you
can custom format is as

mmmm, yy



--


Regards,


Peo Sjoblom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top