sumifs() across tables

sstiebinger

Board Regular
Joined
Nov 7, 2013
Messages
135
I have a couple of tables and I need to sum if based on multiple criteria within these tables.

Table 1 - Sales History:
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Item ID[/TD]
[TD]Order Date[/TD]
[TD]Units Sold[/TD]
[/TR]
[TR]
[TD]40916[/TD]
[TD]4/4/2018[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]41444[/TD]
[TD]5/2/2018[/TD]
[TD]3[/TD]
[/TR]
</tbody>[/TABLE]


Table 2 - Promos:[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Item ID[/TD]
[TD]Promo Start Date[/TD]
[TD]Promo End Date[/TD]
[TD]Sales during period[/TD]
[/TR]
[TR]
[TD]40916[/TD]
[TD]4/1/2018[/TD]
[TD]4/30/2018[/TD]
[TD]???[/TD]
[/TR]
[TR]
[TD]22273[/TD]
[TD]4/1/2018[/TD]
[TD]4/30/2018[/TD]
[TD]???[/TD]
[/TR]
</tbody>[/TABLE]


For Sales During Period I would like the sum of all units sold where:
Table2[Item ID] = Table1[Item ID]
AND
Table1[Order Date] >= Table2[Promo Start Date]
AND
Table1[Order Date] <= Table2[Promo End Date]

I can't figure out the sumifs statement...

Thanks in advance for the help!
 
Last edited:

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
=SUMIFS(Table1[Units Sold],Table1[Item ID],[@[Item ID]],Table1[Order Date],">="&[@[Promo Start Date]],Table1[Order Date],"<="&[@[Promo End Date]])
 
Upvote 0
Thanks!

I was missing the quotes around the operators and the &... didn't realize I needed to send that as a string....

Always learning.
 
Upvote 0

Forum statistics

Threads
1,223,991
Messages
6,175,818
Members
452,672
Latest member
missbanana

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