Reputation: 1343
When I have entered this formula in a cell and press Enter, Excel doesn't accept it.
=SUMIF(MONTH($B$2:$B$61);K2;$A$2:$A$61)
Why?
Upvotes: 0
Views: 1939
Reputation: 11978
Your column C holds the month number, you can use that as criteria range instead of MONTH($B$2:$B$61)
Try =SUMIF(MONTH($C$2:$C$61);K2;$A$2:$A$61)
Upvotes: 2
Reputation: 3310
The problem is that you cannot put MONTH inside of SUMIF. You can replace it with:
=SUM((MONTH($B$2:$B$61)=K2)*$A$2:$A$61)
Upvotes: 2
Reputation: 11197
SUMIF
expects a range. It doesn't want an array of values, it wants a qualified range. Adding MONTH()
around the range turns it into an array of values.
You can see that within VBA, it's explicit as to what it expects.
That's my take on it ...!
Upvotes: 2