Networkdays with start and end times on different days due to multi country shifts

SteelBird

New Member
Joined
Nov 14, 2019
Messages
2
Hi,






I am faced with this scenario where I need to calculate the number of minutes between two date & time stamps with the Start and End time in different hours . My scenario is as below


Excluding Hours between 7:00 PM to 11:00 PM EST all other time, excluding Saturday and Sunday and Holidays need to be calculated


I am currently using this formula, but it yields incorrect results due to the the start and end times spanning multiple days




=IF(U3="Y",,((NETWORKDAYS.INTL(Q3,R3,1,HolidayRef!$A$1:$A$2)-1)*(TimeRef!$A$2-TimeRef!$B$2)+IF(NETWORKDAYS.INTL(R3,R3,1,HolidayRef!$A$1:$A$2),MEDIAN(MOD(R3,1),TimeRef!$A$2,TimeRef!$B$2),TimeRef!$A$2)-MEDIAN(NETWORKDAYS.INTL(Q3,Q3,1,HolidayRef!$A$1:$A$2)*MOD(Q3,1),TimeRef!$A$2,TimeRef!$B$2))*24*60)


Where Y is an internal control variable and my TimeRef sheet has Start Time as 23:01 and End time as ​19:00


I get incorrect results when the time stamps are in the same day or the next day. Some examples are below




Start Date End Date ElapsedTime
5/31/2019 8:42 5/31/2019 9:49 0.00
5/31/2019 9:49 6/6/2019 9:35 -964.00​


Any help would be greatly appreciated!
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,223,885
Messages
6,175,183
Members
452,615
Latest member
bogeys2birdies

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