Urgent - Calculate time between two dates but include working hours of Saturday

sn0365

New Member
Joined
May 10, 2017
Messages
13
Hello,

Can someone please help me with a formula which can help me calculate the total time in hours between two dates but exclude

the total hours starting from Saturday (13:00 hours) to end of Sunday (23:59:59).

Really appreciate your help.

regards,
sn0365
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
NowLast Sat @ 1PM (B2)Last Sun EOD (C2)
2/8/2019 15:112/2/2019 13:002/3/19 11:59 PM
Actual StartActual EndCalc StartCalc End
2/1/2019 08:002/2/2019 14:002/1/2019 08:002/2/2019 13:00
2/3/2019 16:002/4/2019 08:002/3/2019 23:592/4/2019 08:00
2/1/2019 9:002/1/2019 17:002/1/2019 09:002/1/2019 17:00
2/4/2019 9:002/4/2019 17:002/4/2019 09:002/4/2019 17:00

<tbody>
</tbody>
Calculations
B2
Code:
=FLOOR(NOW() -MOD(WEEKDAY(NOW(),1),7),1) +0.542
C2
Code:
=FLOOR(NOW() -(MOD(WEEKDAY(NOW(),1),7) -2),1) -0.0001
C4
Code:
=IF(A4 < FLOOR(NOW() -MOD(WEEKDAY(NOW(),1),7),1) +0.542,A4,IF(A4 < FLOOR(NOW() -(MOD(WEEKDAY(NOW(),1),7) -2),1) -0.0001,FLOOR(NOW() -(MOD(WEEKDAY(NOW(),1),7) -2),1) -0.0001,A4))
D4
Code:
=IF(B4 >FLOOR(NOW() -(MOD(WEEKDAY(NOW(),1),7) -2),1) -0.0001,B4,IF(B4>FLOOR(NOW() -MOD(WEEKDAY(NOW(),1),7),1) +0.542,FLOOR(NOW() -MOD(WEEKDAY(NOW(),1),7),1) +0.542,B4))
C4 & D4 were copied down
To get the difference use D4 - C4 which will give the result in daytime which can be formatted in hours
 
Last edited:
Upvote 0

Forum statistics

Threads
1,218,519
Messages
6,142,937
Members
450,456
Latest member
Exidur

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