Help: Cross Sheet SUMIFS by month between two dates
So I have some data showing the impact level of projects at sites with Start and end dates for each row:
And I want to build a metrics sheet summing the impact by month for each site:
I started with the following:
=SUMIFS({Calendar Data Range 1}, {Calendar Data Range 2}, =Site@row, {Calendar Data Range 3}, AND(IFERROR(MONTH(@cell), 0) >= 12, IFERROR(YEAR(@cell), 0) = 2021), {Calendar Data Range 4}, AND(IFERROR(MONTH(@cell), 0) <= 12, IFERROR(YEAR(@cell), 0) = 2021))
Which doesn't work because both criteria must be met. This tallies a 5 for Syracuse because only the 3rd row meets both criteria. However, in this case Syracuse should have a total impact of 8 for Dec 2021 as both row 2 and 3 show projects running during December 2021.
Any ideas on how to calculate this would be appreciated. Thank you.
Robert Meisch
Sysco Corp.
Best Answer
-
Try this...
=SUMIFS({Calendar Data Range 1}, {Calendar Data Range 2}, =Site@row, {Calendar Data Range 4}, @cell >= DATE(2021, 12, 1), {Calendar Data Range 3}, @cell <= DATE(2021, 12, 31))
Answers
-
I tried this:
=SUMIFS({Calendar Data Range 1}, {Calendar Data Range 2}, =Site@row, {Calendar Data Range 3}, @cell >= DATE(2021, 12, 1), {Calendar Data Range 4}, @cell <= DATE(2021, 12, 31))
Calendar Data Range 3 = Start date column
Calendar Data Range 4 = End date column
But am still getting 5 for Syracuse in December 2021.
-
Try this...
=SUMIFS({Calendar Data Range 1}, {Calendar Data Range 2}, =Site@row, {Calendar Data Range 4}, @cell >= DATE(2021, 12, 1), {Calendar Data Range 3}, @cell <= DATE(2021, 12, 31))
-
That seems to have done the trick.
Thank you Paul!
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 434 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!