Sumif

D

Dennis

I have two columns... in one column, i have a list of
dates. in the other column, i have a $ amount.

I want to use the sumif function to sum the $ amounts
only if the date's month = a certain month.

I've tried doing sumif(arrayA, month(array) = 8, arrayB)
but that doesn't seem to work.

Thanks in advance.
 
W

William

Hi Dennis

Try...
=SUMPRODUCT((MONTH(A1:A29)=2)*B1:B29)

Note the above formula will return values for February of all years in your
range -
to restrict it further to a specific year try...
=SUMPRODUCT((MONTH(A1:A29)=2)*(YEAR(A1:A29)=2004)*B1:B29)

--
XL2002
Regards

William

[email protected]

| I have two columns... in one column, i have a list of
| dates. in the other column, i have a $ amount.
|
| I want to use the sumif function to sum the $ amounts
| only if the date's month = a certain month.
|
| I've tried doing sumif(arrayA, month(array) = 8, arrayB)
| but that doesn't seem to work.
|
| Thanks in advance.
 
B

Biff

Hi Dennis!

Try this to sum all amounts that correspond to August:

=SUMPRODUCT(--(MONTH(A1:A10)=8),B1:B10)

Biff
 
Top