I'm using this formula to calculate working hours which works beautifully until the 3rd day when it seemingly resets my running clock.
=(NETWORKDAYS(B2,B3)-1)*(TIME(16,30,0)-TIME(7,0,0))+IF(NETWORKDAYS(B3,B3),MEDIAN(MOD(B3,1),TIME(16,30,0),TIME(7,0,0)),TIME(16,30,0))-MEDIAN(NETWORKDAYS(B2,B2)*MOD(B2,1),TIME(16,30,0),TIME(7,0,0))
For this example below 2/10 is Monday so all dates below are work days.
I'm testing my formula where start time is in B2 & end time is in B3. If start time is 2/10 at 11:48 am & end time is 2/10 at 1:48 pm it correctly displays 2:00 hours. If I change the date to 2/11 at 1:48 pm it displays 11:30, which is correct. With a working day of 9.5 hours, it added 9.5 to the 2 hours for a total of 11:30 working hours. Changing the end date to 2/12 at 1:48 pm correctly adds another 9.5 hours & displays 21:00 working hours. Changing the date to 2/13 at 1:48 pm & the result then shows 6:30 when it should show 30:50 working hours. Is there a simple step I'm missing here? I have a team member that spends hours a month calculating working dates/times & this could be a huge time saver for them but it needs to be reliable.
Correct math
Error on the 3rd day
=(NETWORKDAYS(B2,B3)-1)*(TIME(16,30,0)-TIME(7,0,0))+IF(NETWORKDAYS(B3,B3),MEDIAN(MOD(B3,1),TIME(16,30,0),TIME(7,0,0)),TIME(16,30,0))-MEDIAN(NETWORKDAYS(B2,B2)*MOD(B2,1),TIME(16,30,0),TIME(7,0,0))
For this example below 2/10 is Monday so all dates below are work days.
I'm testing my formula where start time is in B2 & end time is in B3. If start time is 2/10 at 11:48 am & end time is 2/10 at 1:48 pm it correctly displays 2:00 hours. If I change the date to 2/11 at 1:48 pm it displays 11:30, which is correct. With a working day of 9.5 hours, it added 9.5 to the 2 hours for a total of 11:30 working hours. Changing the end date to 2/12 at 1:48 pm correctly adds another 9.5 hours & displays 21:00 working hours. Changing the date to 2/13 at 1:48 pm & the result then shows 6:30 when it should show 30:50 working hours. Is there a simple step I'm missing here? I have a team member that spends hours a month calculating working dates/times & this could be a huge time saver for them but it needs to be reliable.
Correct math
Error on the 3rd day