Sumproduct calculation

Av8tordude

Well-known Member
Joined
Oct 13, 2007
Messages
1,075
Office Version
  1. 2019
Platform
  1. Windows
I have a table i would like to sum the total for each month of the year, however, I'm not sure why is not calculating the sum. Can someone assist.
The array formula I'm using...

=SUMPRODUCT(MONTH(D16:D45)=T3,YEAR(D16:D45)=U2,P16:P45)

Thank you
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
It seems the "MONTH(D16:D45)=T3 is returning false. T3=January however, I have 6 items listed for the month of January.
 
Upvote 0
If T3 is Text "January", then your structure would need to be
=SUMPRODUCT(--(MONTH(D16:D45)=MONTH("1-"&T3)),--(YEAR(D16:D45)=U2),P16:P45)

but you could also use
=SUMPRODUCT(--(TEXT(D16:D45,"mmmmyyyy")=T3&U2),P16:P45)

and if you have the SUMIFS function
=SUMIFS(P16:P45,D16:D45,">=1"&T3&U2,D16:D45,"<"&EDATE("1-"&T3&U2,1))
 
Upvote 0
Thank you Peter. Is it possible to make this formula dynamic. I will be adding more data to the table?

=SUMPRODUCT(--(TEXT(D16:D45,"mmmmyyyy")=T3&U2),P16:P45)
 
Upvote 0
it is an ordinary range . Range S1:V14

[TABLE="width: 75"]
<tbody>[TR]
[TD][TABLE="width: 300"]
<tbody>[TR]
[TD]Month[/TD]
[TD]2018[/TD]
[TD]2019[/TD]
[TD]2020[/TD]
[/TR]
[TR]
[TD]January[/TD]
[TD] $ -[/TD]
[TD] $ -[/TD]
[TD] $ -[/TD]
[/TR]
[TR]
[TD]February[/TD]
[TD] $ -[/TD]
[TD] $ -[/TD]
[TD] $ -[/TD]
[/TR]
[TR]
[TD]March[/TD]
[TD] $ -[/TD]
[TD] $ -[/TD]
[TD] $ -[/TD]
[/TR]
[TR]
[TD]April[/TD]
[TD] $ -[/TD]
[TD] $ -[/TD]
[TD] $ -[/TD]
[/TR]
[TR]
[TD]May[/TD]
[TD] $ -[/TD]
[TD] $ -[/TD]
[TD] $ -[/TD]
[/TR]
[TR]
[TD]June[/TD]
[TD] $ -[/TD]
[TD] $ -[/TD]
[TD] $ -[/TD]
[/TR]
[TR]
[TD]July[/TD]
[TD] $ -[/TD]
[TD] $ -[/TD]
[TD] $ -[/TD]
[/TR]
[TR]
[TD]August[/TD]
[TD] $ -[/TD]
[TD] $ -[/TD]
[TD] $ -[/TD]
[/TR]
[TR]
[TD]September[/TD]
[TD] $ 1,181.26[/TD]
[TD] $ -[/TD]
[TD] $ -[/TD]
[/TR]
[TR]
[TD]October[/TD]
[TD] $ 16,016.55[/TD]
[TD] $ -[/TD]
[TD] $ -[/TD]
[/TR]
[TR]
[TD]November[/TD]
[TD] $ -[/TD]
[TD] $ -[/TD]
[TD] $ -[/TD]
[/TR]
[TR]
[TD]December[/TD]
[TD] $ -[/TD]
[TD] $ -[/TD]
[TD] $ -[/TD]
[/TR]
[TR]
[TD]YTD Total[/TD]
[TD] $ 17,197.81[/TD]
[TD] $ -[/TD]
[TD] $ -[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Is it possible to make this formula dynamic. I will be adding more data to the table?

=SUMPRODUCT(--(TEXT(D16:D45,"mmmmyyyy")=T3&U2),P16:P45)

it is an ordinary range . Range S1:V14
So, couldn't you just change the 45's in the formula to 100 or 1000 or whatever would be required to ensure that it will be big enough to always cover your table?
 
Upvote 0
So, couldn't you just change the 45's in the formula to 100 or 1000 or whatever would be required to ensure that it will be big enough to always cover your table?

Yes...you have a point. Didn't consider the future file size. Thank you for help and great expertise.
 
Upvote 0
disregard...found a solution. Thanks
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,714
Messages
6,174,052
Members
452,542
Latest member
Bricklin

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