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

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
[TABLE="class: grid, width: 801"]
<tbody>[TR]
[TD]Now[/TD]
[TD]Last Sat @ 1PM (B2)[/TD]
[TD]Last Sun EOD (C2)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]2/8/2019 15:11[/TD]
[TD="align: right"]2/2/2019 13:00[/TD]
[TD="align: right"]2/3/19 11:59 PM[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Actual Start[/TD]
[TD]Actual End[/TD]
[TD]Calc Start[/TD]
[TD]Calc End[/TD]
[/TR]
[TR]
[TD="align: right"]2/1/2019 08:00[/TD]
[TD="align: right"]2/2/2019 14:00[/TD]
[TD="align: right"]2/1/2019 08:00[/TD]
[TD="align: right"]2/2/2019 13:00[/TD]
[/TR]
[TR]
[TD="align: right"]2/3/2019 16:00[/TD]
[TD="align: right"]2/4/2019 08:00[/TD]
[TD="align: right"]2/3/2019 23:59[/TD]
[TD="align: right"]2/4/2019 08:00[/TD]
[/TR]
[TR]
[TD="align: right"]2/1/2019 9:00[/TD]
[TD="align: right"]2/1/2019 17:00[/TD]
[TD="align: right"]2/1/2019 09:00[/TD]
[TD="align: right"]2/1/2019 17:00[/TD]
[/TR]
[TR]
[TD="align: right"]2/4/2019 9:00[/TD]
[TD="align: right"]2/4/2019 17:00[/TD]
[TD="align: right"]2/4/2019 09:00[/TD]
[TD="align: right"]2/4/2019 17:00[/TD]
[/TR]
</tbody>[/TABLE]
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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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