Hi All,
I got stuck while creating the formule for the below scenario. Need your input pls.
The scenario is, I need to calculate the overall time taken to complete a task with the help of start time and end time. The start time and end time is in the format of date and time (10/11/2019 6:50:00 AM). Below are the conditions.
Our shift time starts at 07:00 AM and ends at 03:00 AM next day.
Monday 07:00 AM - Sat 03:00 AM is the time to be considered as week days.
While calculating total time, only the time between 07:00 AM - 03:00 AM should be considered i.e. 04:00 AM to 06:59:00 AM should not be added in the total hours.
Saturday 03:00:01 AM to Monday 06:59:59 AM not to be calculated i.e. only network hours to be calculated.
I created something like the below.
=NETWORKDAYS(IF(AND(MOD(A2,1)>0.125,MOD(A2,1)<0.291667),TEXT(INT(A2),"mm/dd/yyyy")&" 07:00:00 AM",A2),IF(AND(MOD(C2,1)>0.125,MOD(C2,1)<0.291667),
TEXT(INT(C2),"mm/dd/yyyy")&" 07:00:00 AM",C2))-1-MOD(IF(AND(MOD(A2,1)>0.125,MOD(A2,1)<0.291667),TEXT(INT(A2),"mm/dd/yyyy")&" 07:00:00 AM",A2),1)+
MOD(IF(AND(MOD(C2,1)>0.125,MOD(C2,1)<0.291667),TEXT(INT(C2),"mm/dd/yyyy")&" 07:00:00 AM",C2),1)
but the above does not give the desired result.
Few examples for your calculation reference.
A1 - 1/5/2019 12:23:00 AM B1 - 1/7/2019 11:15:00 AM - Total time should be 6.86
A1 - 1/12/2019 12:54:00 AM B1 - 1/14/2019 7:53:00 AM - Total time should be 2.98
A1 - 1/21/2019 1:19:00 PM B1 - 1/23/2019 12:34:00 PM - Total time should be 39.25
Bookmarks