More than 2 logical expressions for OR function?

Options

I'm trying to write an OR function that returns an RYGB ball with 3-4 logical expressions but it keeps giving me an error message. Can it only have 2 logical expressions? Here's my formula (i didn't add the Blue logic yet since I couldn't even get the 3 conditions to work) -

=IF(OR((TODAY() - [Due Date]@row) >= 14, (TODAY() - [Due Date]@row) <= 13, (TODAY() > [Due Date]@row)), "Green", "Yellow", "Red")

The logic is:

If today’s date is >= 14 days from the Due Date, then green ball

If today’s date is <= 13 days days from the Due Date, then yellow

If today’s date is past the Due Date, then red

If today’s date is is past the Due Date, then blue


Thank you!

Best Answers

  • William Tremblay
    edited 06/10/20 Answer ✓
    Options

    You are giving two different options ("Yellow" and "Red") if the logical expression is not met. You must put the desired outcome immediately following each logic check, and the final one is the "every other instance".

    =IF(logical_expression, value_if_true, [value_if_false])

    [value if false] is where you would put the second logic check and associated color following it, and down the line.

    Hope this helps.

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    Answer ✓
    Options

    Yes. Your blue is redundant, but it is not the same as Today's Date >=Due Date.

    Today's Date >=Due Date is the same as the "Red" criteria. Your Blue criteria is a combination of your "Yellow" and "Green".

    Taking out the redundancy of the "Blue", you would have something along the lines of...

    =IF(TODAY() > [Due Date]@row, "Red", IF(TODAY(14) <= [Due Date]@row, "Green", "Yellow"))

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!