NETWORKDAYS not working past 3 days

Dspace

New Member
Joined
Nov 2, 2020
Messages
27
Office Version
  1. 365
Platform
  1. Windows
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
1741797126519.png

Error on the 3rd day
1741797147471.png
 
Your formula looks OK but you need to custom format result cell to [h]:mm

The square brackets mean that excel shows "elapsed time" rather than clock time
 
Upvote 0
Solution
Such a simple solution that I was missing! Thank you. You've saved my employee 6-8 hours of working time a month!
 
Upvote 0
Dspace,

Please Note: In the future, when marking a post as the solution, please mark the post that contains the solution (not your own post acknowledging that some other post was the solution).
When a post is marked as the solution, it is then shown right underneath the original question so people viewing the question can easily see the question and solution in a single quick glance without having to hunt through all the posts.

I have updated this thread for you.
 
Upvote 0
Dspace,

Please Note: In the future, when marking a post as the solution, please mark the post that contains the solution (not your own post acknowledging that some other post was the solution).
When a post is marked as the solution, it is then shown right underneath the original question so people viewing the question can easily see the question and solution in a single quick glance without having to hunt through all the posts.

I have updated this thread for you.
I clicked myself by mistake & then quickly adjusted. I'll improve in the future; this message board is invaluable & don't want to get in any hot water.
My apologies
 
Upvote 0

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