Networkdays odd behavior

Jeffrey Green

Well-known Member
Joined
Oct 24, 2007
Messages
1,021
Cell G10 = 4/10/2018
Cell L10 = 4/9/2018

(It is ok to have negative days in our business)

M10 = =NETWORKDAYS(G10,L10)-1

The answer is get is -3.



Most of my rows are correct, but i see a few of this type issue.


Thoughts?
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
The structure of NETWORKDAYS is:
NETWORKDAYS(start date, end date, holidays)

So the earlier date is usually the first date.
Yours is reversed, so it will return -2 instead of 2.
And then is it just simple math, subtracting -1 from -2 gives you -3.
So that is expected behavior.

If the answer you are looking for is 1, because you want it to say 2 workdays minus 1 is 1, and you don't want to change the order of the fields in your formula, then change it to:
Code:
[COLOR=#333333]=ABS(NETWORKDAYS(G10,L10))-1[/COLOR]
 
Last edited:
Upvote 0
THanks Joe . .. the order of dates is correct, but i dont want to count the first day, that is why i do +1. But if we release something before it arrives (which can happen), I want something like....IF the original networkdays is negative, then instead of subtracting one, i need to ADD 1. I cant seem to get that to work, though. help! thanks
 
Last edited:
Upvote 0
Try:
Code:
[COLOR=#333333]=NETWORKDAYS(G10,L10) + IF(G10>L10,1,-1)[/COLOR]
 
Upvote 0
Deleted as better solution in previous post by Joe4.
 
Last edited:
Upvote 0
unless there is a cleaner way, this appears to work . . . .

thanks

=IF(NETWORKDAYS(G83,L83)-1 < 0,NETWORKDAYS(G83,L83)+1,NETWORKDAYS(G83,L83)-1)
 
Upvote 0
unless there is a cleaner way, this appears to work . . . .

thanks

=IF(NETWORKDAYS(G83,L83)-1 < 0,NETWORKDAYS(G83,L83)+1,NETWORKDAYS(G83,L83)-1)
The answer I posted up in post 4 only involves a single NETWORKDAYS calculation, so it should be more efficient.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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