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!
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: