Sumifs for an array of date ranges?

kingkong1028

New Member
Joined
Jan 24, 2014
Messages
31
So alright, this is a little hard to explain, but I will try my best: I have 3 columns of dates: A, B and C. I have another column of the money in D. I would like to be able to do this: if a value in C2, says 6/16/2014, is in between the dates in A2 and B2, says 6/15/2014 and 6/18/2014, then D2, says $ 1 MM will be added to the final sum. Do this until we get through all the ranges of dates: say from A2-B2 to A100-B100. Is there an easy way (one formula) to do this. If you need more clarification, let me know. So in short, I need to do sumifs of the money in column D if a value of date in a cell in column C is within an array of a range of dates in column A and B.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
This seems to work:


Excel 2010
ABCDE
1StartEnd16/06/201410110
215/06/201418/06/201419/06/201420
315/07/201416/07/201413/07/201430
423/08/201425/08/201416/07/201440
515/08/201450
624/08/201460
Sheet1
Cell Formulas
RangeFormula
E1=SUMPRODUCT(SUMIFS(D1:D6,C1:C6,">="&A2:A4,C1:C6,"<="&B2:B4))
 
Upvote 0
Thank you for the quick response. However, what I meant was: if C1 is in between the range of a2-b2, a3-b3, a4-b4, then sum up all of those associated D cells for C1. Then repeat for C2, C3 to C6. So we are doing a sumifs where the criteria range is 1 value, while the criteria is a range of ranges of dates.
Start Date
End Date
Date
Money
Final
6/16/2014
7/1/2014
6/16/2014
10
150
6/16/2014
6/23/2014
6/17/2014
20
150
6/16/2014
6/30/2014
6/18/2014
30
150
6/16/2014
7/15/2014
7/2/2014
40
90
6/16/2014
7/16/2014
7/31/2014
50

<tbody>
</tbody>
So for instance, since for the date: 7/31/2014 is not in between the ranges of any of the dates, the final money is 0. The date 7/2/2014, is between the ranges of 6/16 to 7/15 and 6/16 to 7/16 so the final sum is 40+50 = 90.
 
Last edited:
Upvote 0
Like this?


Excel 2010
ABCDE
1StartEndDateMoney
216/06/201401/07/201416/06/201410150
316/06/201423/06/201417/06/201420150
416/06/201430/06/201418/06/201430150
516/06/201415/07/201402/07/20144090
616/06/201416/07/201431/07/2014500
Sheet1
Cell Formulas
RangeFormula
E2=SUMIFS(D$2:D$6,A$2:A$6,"<="&C2,B$2:B$6,">="&C2)
 
Upvote 0
Like this?

Excel 2010
ABCDE
1StartEndDateMoney
216/06/201401/07/201416/06/201410150
316/06/201423/06/201417/06/201420150
416/06/201430/06/201418/06/201430150
516/06/201415/07/201402/07/20144090
616/06/201416/07/201431/07/2014500

<colgroup><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
E2=SUMIFS(D$2:D$6,A$2:A$6,"<="&C2,B$2:B$6,">="&C2)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

The formula didn't work for me :(
 
Upvote 0
With the same data as I posted? Note that I am using UK style dates and the data is in A1:D6 with headings in row 1.
 
Upvote 0

Forum statistics

Threads
1,214,611
Messages
6,120,510
Members
448,967
Latest member
screechyboy79

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