Formula to calculate/split out hours in range

MrMaker

Board Regular
Joined
Jun 7, 2018
Messages
53
Office Version
  1. 365
Platform
  1. Windows
Morning,

I need a little bit of help please.

Simply, I have a start date/time and an end time/date, and I need to split out the total number of hours (or decimal days) in the range so that they are apportioned to each day that they fall in:

Data:

A2) arrived date/time 01/02/2018 09:00

B2) end date/time 03/02/2018 15:30

Output Requirements:

C2 ) how many hours in the above were on 01/02/18 (i.e. between 01/02/2018 09:00 and 01/02/2018 23:59)

D2) how many hours in the above were on 02/02/18 (i.e. between 02/02/2018 00:00 and 02/02/2018 23:59)

E2) how many hours in the above were on 03/02/18 (i.e. between 03/02/2018 00:00 and 03/02/2018 15:30)

Hopefully this makes sense and thank you in advance
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Try:


Book1
ABCDEFG
1
22/1/2018 9:00
32/3/2018 18:00
4
5start2/1/2018 9:002/2/2018 0:002/3/2018 0:002/3/2018 15:30
6end2/2/2018 0:002/3/2018 0:002/3/2018 15:302/3/2018 23:00
7# of hours15.024.015.52.5
Sheet4
Cell Formulas
RangeFormula
D7=MAX(0,MIN(D6,$B$3)-MAX(D5,$B$2))*24
E7=MAX(0,MIN(E6,$B$3)-MAX(E5,$B$2))*24
F7=MAX(0,MIN(F6,$B$3)-MAX(F5,$B$2))*24
G7=MAX(0,MIN(G6,$B$3)-MAX(G5,$B$2))*24
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,397
Members
449,081
Latest member
JAMES KECULAH

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