Multiple if statements

I am receiving an unparseable error and I don't understand why. I have two different if statements. They work individually.

=IF([Working days until due date]@row > 0; "Red")

=IF([Working days until due date]@row < 0; "Green")

But when I combine them it won't work:

=IF([Working days until due date]@row > 0; "Red"); IF([Working days until due date]@row < 0; "Green")


Can anybody help me out?

Best Answers

  • Bassam Khalil
    Bassam Khalil ✭✭✭✭✭✭
    Answer ✓

    @Roos

    Hope you are fine, please try the following formula:

    =IFERROR(IF([Working days until due date]@row >= 0, "Red", 
    IF([Working days until due date]@row < 0, "Green")), "")
    

    the following screenshot shows the result:


    PMP Certified

    bassam.khalil2009@gmail.com

    ☑️ Are you satisfied with my answer to your question? Please help the Community by marking it as an ( Accepted Answer), and I will be grateful for your "Vote Up" or "Insightful"

  • Bassam Khalil
    Bassam Khalil ✭✭✭✭✭✭
    Answer ✓

    Please accept my answer. Iferror is used to avoid any unexpected results because if bad inputs

    PMP Certified

    bassam.khalil2009@gmail.com

    ☑️ Are you satisfied with my answer to your question? Please help the Community by marking it as an ( Accepted Answer), and I will be grateful for your "Vote Up" or "Insightful"

Answers

  • The third one I would like to add is: =IF(AND([Working days until due date]@row > 0; [Working days until due date]@row < 10); "Yellow")

  • Bassam Khalil
    Bassam Khalil ✭✭✭✭✭✭
    Answer ✓

    @Roos

    Hope you are fine, please try the following formula:

    =IFERROR(IF([Working days until due date]@row >= 0, "Red", 
    IF([Working days until due date]@row < 0, "Green")), "")
    

    the following screenshot shows the result:


    PMP Certified

    bassam.khalil2009@gmail.com

    ☑️ Are you satisfied with my answer to your question? Please help the Community by marking it as an ( Accepted Answer), and I will be grateful for your "Vote Up" or "Insightful"

  • Roos
    Roos
    edited 10/27/21

    This worked thank you so much.

    Could you explain what the iferror does?

  • Bassam Khalil
    Bassam Khalil ✭✭✭✭✭✭
    Answer ✓

    Please accept my answer. Iferror is used to avoid any unexpected results because if bad inputs

    PMP Certified

    bassam.khalil2009@gmail.com

    ☑️ Are you satisfied with my answer to your question? Please help the Community by marking it as an ( Accepted Answer), and I will be grateful for your "Vote Up" or "Insightful"

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!