What is wrong with my IF...AND stmt?

Lashawnta Barker
edited 03/04/21 in Smartsheet Basics

=IF(AND([# of Days Open]@row >= 22, Status@row = "Pending Review"), "Red",

IF(AND([# of Days Open]@row <= 14, Status@row = "Pending Review"), "Green",

IF(AND(Status@row = "Pending Review", AND([# of Days Open]@row >= 15, [# of Days Open]@row <= 21), "Yellow"))))

In my calc above, it was working fine until I added the 3rd IF stmt solving for Yellow. I'm basically wanting to code my bubble yellow if project status = Pending Review AND the # of Days Open is between 15 and 21. What am I missing? Is it the last AND function that's causing issues?

SB

Tags:

Best Answer

  • Lashawnta Barker
    Answer ✓

    This was corrected by adding in the parenthesis in the right sections. Basically they were in the wrong spot. See revised code below.

    =IF(AND([# of Days Open]@row >= 22, [Status]@row = "Pending Review"), "Red",

    IF(AND([# of Days Open]@row <= 14, [Status]@row = "Pending Review"), "Green",

    IF(AND([Status]@row = "Pending Review", AND([# of Days Open]@row >= 15, [# of Days Open]@row <=

    21)), "Yellow", " ")))

Answers