network days formula question

steve400243

Active Member
Joined
Sep 15, 2016
Messages
292
Hello, I use this cell formula to calculate network days based on the dates entered in the cells it looks at. In some cases it will return a negative number like -2 or -3, If the number returned is negative Is there a way to have the cell just read 0? Thank you for your help.

VBA Code:
=IF(NETWORKDAYS.INTL(LOOKUP(2,1/($G$3:$G3>0),$G$3:$G3),I3),NETWORKDAYS(LOOKUP(2,1/($G$3:$G3>0),$G$3:$G3),I3,Sheet2!$B$2:$B$7))-1
 

Some videos you may like

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
53,008
Office Version
  1. 365
Platform
  1. Windows
How about
=MAX(IF(NETWORKDAYS.INTL(LOOKUP(2,1/($G$3:$G3>0),$G$3:$G3),I3),NETWORKDAYS(LOOKUP(2,1/($G$3:$G3>0),$G$3:$G3),I3,Sheet2!$B$2:$B$7))-1,0)
 

CA_Punit

Well-known Member
Joined
Nov 18, 2019
Messages
884
Office Version
  1. 365
Platform
  1. Windows
Can you post a sample data

i am confused as how is this formula working

Anyways Fluff has replied but out of curiosity if you can provide a sample so that i can clear my confusion

I am confused with this.
NETWORKDAYS.INTL(LOOKUP(2,1/($G$3:$G3>0),$G$3:$G3),I3) what will happen if this is Negative Number or 0
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
53,008
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

steve400243

Active Member
Joined
Sep 15, 2016
Messages
292
Can you post a sample data

i am confused as how is this formula working

Anyways Fluff has replied but out of curiosity if you can provide a sample so that i can clear my confusion

I am confused with this.
NETWORKDAYS.INTL(LOOKUP(2,1/($G$3:$G3>0),$G$3:$G3),I3) what will happen if this is Negative Number or 0

I use it to count days for an analysis report, G3 is the Unloaded Date. I3 is the Date the needed paperwork is received. No weekends or company holidays are counted. If the number is less than 0, it will record -1, -2 etc. I may have the formula wrong or there may be an easier way?
 

Watch MrExcel Video

Forum statistics

Threads
1,122,670
Messages
5,597,483
Members
414,146
Latest member
marginmakerb

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
Top