network days formula question

steve400243

Active Member
Joined
Sep 15, 2016
Messages
429
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
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
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
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)
 
Upvote 0
Thank you Fluff, I was missing the "Max" in my testing. Thanks for your time.
 
Upvote 0
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
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
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?
 
Upvote 0

Forum statistics

Threads
1,214,648
Messages
6,120,726
Members
448,987
Latest member
marion_davis

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