I am using NETWORKDAYS to calculate the difference between two work dates and am having a frustrating problem. In cell E4 is 11/20 and in cell D4 is 11/21. The difference between those two days should be 1 but Excel is giving me 3. Why?
3, Are you sure? NETWORKDAYS counts both start and end date so I'd expect the answer to be 2. As long as start and end dates will both be working days you can just subtract 1 from the result to give you the difference in working days
That is what I did (use -1) and I just tested on a fresh spreadsheet.
If you put 11/20 in A1 and 11/21 in B1, =NETWORKDAYS(A1,B1)-1 in cell C1 returns 1, which is correct. Switch the two dates (put 11/21 in A1 and 11/20 in B1) and you will see it returns a three all of a sudden.
With NETWORKDAYS if the first date (in the formula) is later than the second date you get a negative value, in this case -2 then you are subtracting a further 1 so you get -3
Is it valid for you to have negative results? If so then you probably need to add 1, not subtract, in that scenario. You can automate that with this formula
=NETWORKDAYS(A1,B1)-SIGN(NETWORKDAYS(A1,B1))
If you use that formula then you get 1 for the dates in order or -1 for the dates reversed
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.