Date within date range query

Microsoft

Board Regular
Joined
Jun 16, 2016
Messages
108
Hi All,

Sheet1

StartEndBilling Period
01/01/190015/05/20171
16/05/201715/06/20172
16/06/201714/07/20173
15/07/201715/08/20174
16/08/201715/09/20175

<tbody>
</tbody>

Sheet2

Event DetailsStart DateEnd DateNumber of NightsBilling Period(s)
Event A17/05/201719/05/201722
Event B12/07/201717/07/201742 nights in billing period 3, 2 nights in billing period 4

<tbody>
</tbody>

What I would like to do is show which billing period(s) the events in sheet2 fall under, based on the data in sheet1 (The answer for Event A would be billing period 2 only. The answer to Event B is much more complex)

Each "Event" occurs at night, Sunday - Thursday ONLY. Based on this, Event B would run Wednesday, Thursday, Sunday and Monday evenings. Hence a four night event for Event B.

Event B "straddles" over two billing periods (3 and 4). The first two nights would be in billing period 3 (Wednesday 12th July 2017, Thursday 13th July 2017). The second two nights would be in billing period 4 (Sunday 16th July 2017, Monday 17th July 2017)

The table in sheet2 shows how the answers would be displayed, but I am very open to easier ways of displaying my results. The critical thing is that I need to know how many of the total number of nights, fell within which billing period.

I would happily do this manually, but I have around 800 events to review :(

Thanks in advance to anyone who can help!
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,215,370
Messages
6,124,526
Members
449,169
Latest member
mm424

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