Networkdays for delay calculation without weekends

KeLo

New Member
Joined
Aug 25, 2022
Messages
2
Office Version
  1. 2016
Hi all, I am new to the forum and newish to Excel. I am having trouble calculating delay based on two dates when the second date is earlier than the first when using Networkdays. You can see in my example the formula returns -3 instead of -1. Thanks for your help!

2022-08-25_10-27-56.png
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Excel is smart enough to treat networkdays with loss in the past (end date is < start date) in opposite with in the future, then use:
Code:
=NETWORKDAYS(AB43,AD43)-IF(AD43>=AB43,1,-1)
 
Upvote 0
Hi Kelo,
Welcome to the board.

for your query, excel is returning -3 because:
1. Networkdays counts the number of days in between start date and end date. To overcome this, single day is deducted using -1.
2. Since your end date is less then your start date, networkdays tries to deduct your start date from end date and results in -2,
3. but since you already have a -1 in your formula, excel sums up -2 and -1 and returns -3.

to solve this you should wrap all your formula in an if statement like below:

Excel Formula:
=IF(B1>=A1,NETWORKDAYS(A1,B1)-1,NETWORKDAYS(A1,B1)+1)

The condition will first check if end date is greater or less then the start date. If it is less then the start date then -1 will be applied. Else if it is greater then start date then the formula will add 1 to your result.

HTH...
 
Upvote 0
Excel is smart enough to treat networkdays with loss in the past (end date is < start date) in opposite with in the future, then use:
Code:
=NETWORKDAYS(AB43,AD43)-IF(AD43>=AB43,1,-1)
Thanks for the answer!
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,693
Members
449,048
Latest member
81jamesacct

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