Using the NETWORKDAYS formula

RaydenUK

Board Regular
Joined
Mar 25, 2014
Messages
74
I am using the formula =NETWORKDAYS(A2,B2)-1-MOD(A2,1)+MOD(B2,1) where A2 is the start date and B2 is the end date. The NETWORKDAYS function works fine by ignoring the weekend days, however, if the end date is on a weekend then the formula doesn't work, it just gives ########. Is there a way to modify this formula to say that if the end date is on saturday at 8am, for example, then the result would reflect the time ending on Friday at 11:59pm? Therefore, if the start date is Friday at 8am then the cell would say "15:59", since it is only calculating from 8am to 11:59pm on friday, while ignoring saturday.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Try:
Code:
=NETWORKDAYS(A2,B2)-1-MOD(A2,1)+IF(WEEKDAY(B2,2)<6,MOD(B2,1),TIME(23,59,0))
If this doesn't get your expected results, please post some sample data along with your expected results.
 
Upvote 0

Forum statistics

Threads
1,215,500
Messages
6,125,168
Members
449,211
Latest member
ykrcory

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