Summing a range if the date is between two dates, but also equal to a separate date in Excel

Meetloaf13

New Member
Joined
Mar 10, 2019
Messages
3
So, I have an excel sheet that tracks events that are booked for a certain date (Range = eventdate), and then payments (Ranges = payment1, payment2, payment3, payment4) are logged at certain correlating dates (Ranges = date1, date2, date3, date4).
I have a formula that sums all deposits within a date range (on and in between dates in cells Y2 & Y3):
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;"> =SUMIFS(Payment1,date1,">="&Y2,date1,"<="&Y3)+SUMIFS(Payment2,date2,">="&Y2,date2,"<="&Y3)+SUMIFS(Payment3,date3,">="&Y2,date3,"<="&Y3)+SUMIFS(Payment4,date4,">="&Y2,date4,"<="&Y3)
</code>This formula is summing properly.
But when I add the third requirement, to sum not only payments made on or in between Y2 & Y3, but also payments made on the 'eventdate', I get $0.
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">=SUMIFS(Payment3,date3,">="&Y2,date3,"<="&Y3,date3,eventdate)
</code>I have verified that the dates do indeed equal.
Interestingly, when I remove the other dating syntax, I get the proper summation:
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">=SUMIFS(Payment3,date3,eventdate)
</code>I would love it if someone could help me figure out where I've gone awry.
Thank you!

Update:
As I've tried to further troubleshoot the issue, I decided to break the sumifs formula down to it's cell references instead of the correlating ranges, and it returns the correct value: =SUMIFS(J9,I9,">="&Y2,I9,"<="&Y3,I9,C9)
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Just updating with my answer. Learned a bit out SUMPRODUCT, more versatile than SumIFs:

Code:
=SUMPRODUCT(--(date1>=Y2)*--( date1<=Y3)*--(date1=eventdate),Payment1)+SUMPRODUCT(--(date2>=Y2)*--( date2<=Y3)*--(date2=eventdate),Payment2)+SUMPRODUCT(--(date3>=Y2)*--( date3<=Y3)*--(date3=eventdate),Payment3)+SUMPRODUCT(--(date4>=Y2)*--( date4<=Y3)*--(date4=eventdate),Payment4)
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,241
Members
452,622
Latest member
Laura_PinksBTHFT

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