Sumproduct function

scooter155

New Member
Joined
Jan 22, 2007
Messages
4
I have a column (A) with dates formatted this way "Tuesday, September 04, 2018".
I also have a column (B) with corresponding amounts in it.
I am trying to use Sumproduct to add all the amounts in column B by month using this formula =SUMPRODUCT((MONTH($A$3:$A$3238)=$C3210)*($B$3:$B$3238))

C3210-C3221 equals the numbers 1-12 to correspond with January-December.
As soon as I extend the formula to go further than row 3238, I get a value error. It works fine as long as I am adding all the data prior to that. There is no data in those rows after 3238 but there will be in the future. I don't want to have to change the formula every time I add data.

I am also adding by year and seem to have no problem using this formula =SUMIFS($B:$B,$A:$A,">=January 1, 2018",$A:$A,"<=December 31, 2018")


Any help would be greatly appreciated.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
You shouldn't get a #VALUE ! error with that formula unless there are text cells in column A of the 'unused' data rows. Do you perhaps have formulas returning "" in those cells? If so, you might use:

=SUMPRODUCT(IFERROR(INDEX(MONTH($A$3:$A$3238)=$C2,0),0)*($B$3:$B$3238))
 
Last edited:
Upvote 0
Did you try the formula I added? (you might not have seen it as I edited the post to add it after originally posting)
 
Upvote 0
Having looked at your workbook, you have a space in cell B3238 which is what causes the error.
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,300
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top