SumProduct within date range with two worksheets

BrutalDawg

New Member
Joined
Jun 10, 2015
Messages
41
I am having trouble creating a viable formula that will sum the product found on the sheet1 within a certain date range.

I would like to enable it as a vlookup. Essentially, look for item one sheet1, and total sum within the month.

Similar to below.

Sheet1:
[TABLE="width: 460"]
<colgroup><col><col><col span="2"><col><col><col></colgroup><tbody>[TR]
[TD]Location[/TD]
[TD]Issue[/TD]
[TD]SI[/TD]
[TD]Item[/TD]
[TD]Time[/TD]
[TD]Qty[/TD]
[TD]When[/TD]
[/TR]
[TR]
[TD]Ohio[/TD]
[TD="align: right"]4/10/2018[/TD]
[TD] [/TD]
[TD="align: right"]123[/TD]
[TD]Firm[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]4/9/2018[/TD]
[/TR]
[TR]
[TD]Ohio[/TD]
[TD="align: right"]4/10/2018[/TD]
[TD] [/TD]
[TD="align: right"]321[/TD]
[TD]Firm[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]4/9/2018[/TD]
[/TR]
[TR]
[TD]Ohio[/TD]
[TD="align: right"]4/10/2018[/TD]
[TD] [/TD]
[TD="align: right"]567[/TD]
[TD]Firm[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]4/9/2018[/TD]
[/TR]
[TR]
[TD]Ind[/TD]
[TD="align: right"]4/10/2018[/TD]
[TD] [/TD]
[TD="align: right"]123[/TD]
[TD]Firm[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]4/16/2018[/TD]
[/TR]
[TR]
[TD]Ind[/TD]
[TD="align: right"]4/10/2018[/TD]
[TD] [/TD]
[TD="align: right"]321[/TD]
[TD]Firm[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]4/16/2018[/TD]
[/TR]
[TR]
[TD]Ind[/TD]
[TD="align: right"]4/10/2018[/TD]
[TD] [/TD]
[TD="align: right"]567[/TD]
[TD]Firm[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]4/16/2018[/TD]
[/TR]
[TR]
[TD]NO[/TD]
[TD="align: right"]4/10/2018[/TD]
[TD] [/TD]
[TD="align: right"]123[/TD]
[TD]Forecast[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]5/1/2018[/TD]
[/TR]
[TR]
[TD]NO[/TD]
[TD="align: right"]4/10/2018[/TD]
[TD] [/TD]
[TD="align: right"]321[/TD]
[TD]Forecast[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]5/1/2018[/TD]
[/TR]
[TR]
[TD]NO[/TD]
[TD="align: right"]4/10/2018[/TD]
[TD] [/TD]
[TD="align: right"]567[/TD]
[TD]Forecast[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]5/1/2018
[/TD]
[/TR]
</tbody>[/TABLE]

Sheet2 with desired results:

[TABLE="width: 328"]
<colgroup><col><col><col span="2"><col></colgroup><tbody>[TR]
[TD]Item[/TD]
[TD]April[/TD]
[TD]May[/TD]
[TD]June[/TD]
[TD]Jul[/TD]
[/TR]
[TR]
[TD="align: right"]123[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD="align: right"]321[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD="align: right"]567[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0
[/TD]
[/TR]
</tbody>[/TABLE]

formula in sheet 2 for apr,may,jun etc. would look for corresponding item on sheet1, and total the qty within that particular month.

Thanks for any help or suggestions
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Your output is not consistent You have April May June and Jul. There is no month called Jul. It's July.
Make your data consistent or this will not work.

With Sheet2 Column A containing Item numbers and Sheet2 row 1 contaning month names try

Im assuming Sheet1 Column D is Item and you have no SI data in column C, thats what it looks like

in Sheet2!B2
=SUMPRODUCT((Sheet1!$D$1:$D$1000=Sheet2!$A2)*(TEXT(Sheet1!$B$1:$B$1000,"mmmm")=Sheet2!B$1)*(Sheet1!$F$1:$F$1000))
copy across and down
 
Last edited:
Upvote 0
Your output is not consistent You have April May June and Jul. There is no month called Jul. It's July.
Make your data consistent or this will not work.

With Sheet2 Column A containing Item numbers and Sheet2 row 1 contaning month names try

Im assuming Sheet1 Column D is Item and you have no SI data in column C, thats what it looks like

in Sheet2!B2
=SUMPRODUCT((Sheet1!$D$1:$D$1000=Sheet2!$A2)*(TEXT(Sheet1!$B$1:$B$1000,"mmmm")=Sheet2!B$1)*(Sheet1!$F$1:$F$1000))
copy across and down
Thanks for your help but I kept receiving a data error. I am currently trying this formula.

=SUMIFS(edi!F:F,edi!G:G,">="&Sheet1!G1,edi!G:G,"<="&G2,edi!D:D,A2)

Where A2 is the item I am looking for, g1 and g2 are beginning and end dates of the month. ie g1-4/1/2018 g2-4/30/2018 which seems to give me my desired result, but when I try and drag through, it changes to H2&H3, I3&I4, and so on. Anyone know how to lock the row, but let the column move?
 
Upvote 0
Your dates may be a mixture of dates and text depending on the (as yet undivulged) error message

Anchor them with $ signs

=SUMIFS(edi!F:F,edi!G:G,">="&Sheet1!$G$1,edi!G:G,"<="&$G$2,edi!D:D,A2)
 
Last edited:
Upvote 0
Your dates may be a mixture of dates and text depending on the (as yet undivulged) error message

Anchor them with $ signs

=SUMIFS(edi!F:F,edi!G:G,">="&Sheet1!$G$1,edi!G:G,"<="&$G$2,edi!D:D,A2)

Thanks Special, I had been trying to lock before the sheet designation. You are correct.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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