Summing across date bands

smapple

New Member
Joined
Jan 15, 2018
Messages
6
Hello,

I'm sure this is fairly straightforward, but I ended up doing a manual workaround that I'm keen to avoid in the future.

I have three columns of data. I want to know what the exposure was over each day, where the 'To' and 'From' dates are inclusive. For example, on the 3 January, the exposure would be 150 + 200 + 100 = 450. As you can see, the dates often overlap, which made the manual process pretty painful.

Is there a way, using VBA or a formula, to automate this? I tried concatenating the To/From fields and using a SumIfs but I got lost with the date convention. The convention I'm using is dd/mm/yy in my spreadsheet.

Many thanks for your help.
ExposureToFrom
1501 Jan 20185 Jan 2018
2003 Jan 201810 Jan 2018
22012 Jan 201831 Jan 2018
8015 Jan 201831 Jan 2018
1001 Jan 201831 Jan 2018

<tbody>
</tbody>
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
With the target date (3 Jan 2018) in cell E2, try this:

=SUMPRODUCT(--(B2:B6<=E2),--(C2:C6>=E2),A2:A6)
 
Upvote 0

Forum statistics

Threads
1,215,465
Messages
6,124,975
Members
449,200
Latest member
Jamil ahmed

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