Using IF with Networkdays
Hi All,
I am trying to calculate the number of days in SS and adding a clause that if the difference is greater than 45, it should return "No". If it is lower, it should return "YES".
Unfortunately, my code is not working, and I am stuck.
The formula I am using is the following:
= IF((NETWORKDAYS([Sent to NewOrder]2, [Sent to Billing]2)) <= 45, "YES", IF((NETWORKDAYS([Sent to NewOrder]2, [Sent to Billing]2)) > 45, "NO"))
Can someone help me, please?
Best Answer
-
@Pamella Souza I have tested your request and here is your formula that works - attached example image for your help. Make sure your date columns are all column type "DATE" sometimes the smallest things get overlooked! :)
=IF(NETWORKDAYS([Start Date]@row, [End Date]@row) <= 45, "YES", "NO")
Cheers!
Ipshita Mukherjee
Answers
-
=IF(NETWORKDAYS([Sent to NewOrder]2, [Sent to Billing]2) <= 45, "YES", IF(NETWORKDAYS([Sent to NewOrder]2, [Sent to Billing]2) > 45, "NO"))
There's no need to wrap the NETWORKDAYS in a double set of parenthesis. You also have a space between the = and the IF. You can probably even shorten it to this:
=IF(NETWORKDAYS([Sent to NewOrder]2, [Sent to Billing]2) <= 45, "YES", "NO")
-
Hi Mike,
Thank you for your response.
It partially worked. The problem now is that I am getting "YES" even if the results are greater than 45 days.
I am using another formula to confirm the number of days. And that I how I know it is showing for both.
Can you help me with that?
Kind Regards,
Pamella Souza.
-
Can you please show the formula on your sheet with the 2 columns it's evaluating?
-
Hi Mike,
Please refer to the attached picture:
I tested both ways.
Thanks in advance for your help.
Cheers.
-
I also thought about storing the difference between two dates in a variable and then using the if to make the comparison.
But I was successful in my tests.
-
Anyone?
-
@Pamella Souza - I am yet to test your formula and would return the answer shortly but in the meantime, try using the IFERROR to your formula instead of IF and run.
Let me know if that works!
Cheers!
Ipshita Mukherjee
-
@Pamella Souza I have tested your request and here is your formula that works - attached example image for your help. Make sure your date columns are all column type "DATE" sometimes the smallest things get overlooked! :)
=IF(NETWORKDAYS([Start Date]@row, [End Date]@row) <= 45, "YES", "NO")
Cheers!
Ipshita Mukherjee
-
Hi Ipshita,
It worked.
Thank you very much! I appreciate your help.
Have a good one!
Cheers!
-
Hi @Pamella Souza - I am glad it worked and would really appreciate it if you can give a "Awesome" or something to my response that worked for you.
Cheers :)
Ipshita
Ipshita Mukherjee
-
-
Ipshita Mukherjee
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.5K Get Help
- 402 Global Discussions
- 213 Industry Talk
- 450 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 135 Just for fun
- 56 Community Job Board
- 454 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 296 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!