How many hours fall between a day and time range

ElBB23

New Member
Joined
Feb 10, 2017
Messages
26
Hi all,

I have been trying to find a formula that will tell me how many hours fall between two specific date/time ranges.

So

Range One
Starts: Friday 01:00
Ends: Sunday 17:59:59


Range Two
Starts: Sunday 18:00
Ends: Friday 00:59:59


The ranges can be variable and I need it to round up to a whole hour. So if I had a time span of Sunday 16:00-23:00.

Range 1------------Range 2

2.00------------------5.00


I have been trying for a while now and am struggling with the day and time so any help would be appriciated. I'm happy to split things up or add things.

Thanks in advance.

 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Format A1:A6 as : dd/mm/yy hh:mm:ss
Input :
A1 - 10/08/18 01:00:00
A2 - 12/08/18 17:59:59
A3 - 12/08/18 18:00:00
A4 - 17/08/18 00:59:59
A5 - 12/08/18 16:00:00
A6 - 12/08/18 23:00:00

Format B5:B6 as : 0
Enter in B5 : =IF(A2>A5,ROUND((A2-A5)*24,0),0)
Enter in B6 : =IF(A3 < A6,ROUND((A6-A3)*24,0),0)<a6,round((a6-a3)*24,0),0)< html=""></a6,round((a6-a3)*24,0),0)<>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,164
Members
453,021
Latest member
Justyna P

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