Forum Discussion

Nikoss's avatar
Nikoss
Copper Contributor
Nov 02, 2020
Solved

IF statement with OR and NETWORKDAYS

Hello I have some trouble adding the OR function to this statement:

=IF(AD3="","",NETWORKDAYS(AC3,AD3))

So far I am saying that if AD3 is blank then the result should be blank otherwise the result should be the number of business days between AC3 and AD3.

Now I also need the result to be blank if AF3="Yes" so I tried =IF(OR(AD3="",AF3="Yes",""),NETWORKDAYS(AC3,AD3)) but I get #VALUE!

The correct results should be:

If AD3 is blank and AF3 is "Yes" The result should be blank

If AD3 is blank and AF3 is "No" The result should be blank

If AD3 is NOT blank and AF3 is "Yes" The result should be blank

If AD3 is NOT blank and AF3 is "No" The result should count business days between AC3 and AD3

 

What am I doing wrong? I have attached a screenshot of the spreadsheet for more help.

 

 

6 Replies

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    Nikoss I believe you have bracket in the wrong place. Try it this way.

    =IF(OR(AD3="",AF3="Yes"),"",NETWORKDAYS(AC3,AD3))

     

    • hezb158's avatar
      hezb158
      Copper Contributor

      Riny_van_Eekelen using the same principal how would I use this if I were to calculate my networking days from TODAY and past dates?

      • Riny_van_Eekelen's avatar
        Riny_van_Eekelen
        Platinum Contributor

        hezb158 This thread was about how to write an OR function. Better to start a new thread with your own question relating to the NETWORKDAYS function.

    • Nikoss's avatar
      Nikoss
      Copper Contributor
      Thank you so much it works now!

Resources