# If And Statement Issue

Options
✭✭✭

Smartsheet Community:

I am Trying Have My Rag Change to Not Started When The Following Conditions Are Met and Add it to My Existing Formula:

IF(AND([Schedule Variance]@row = 0, [Progress Status]@row = "Not Started", "Not Started"

I Keep Receiving a Green Instead of Not Started. Her is My Complete Formula Below:

=IF([% Complete (Actual)]@row = 1, "Blue", IF([Schedule Variance]@row = 0, "Green", IF([Schedule Variance]@row > 0, "Green", IF(AND([Schedule Variance]@row = 0, [Progress Status]@row = "Not Started", "Not Started", IF([Schedule Variance]@row <= -7, "Red", "Yellow"))))))

Thanks

• ✭✭✭
Options

I Figured it Out. I Had to Change The Order to a Higher Condition. See Below:

=IF([% Complete (Actual)]@row = 1, "Blue", IF(AND([Schedule Variance]@row = 0, [Progress Status]@row = "Not Started"), "Not Started", IF([Schedule Variance]@row >= 0, "Green", IF([Schedule Variance]@row <= -7, "Red", "Yellow"))))

• ✭✭✭✭✭
edited 05/10/24
Options
```=
IF([% Complete (Actual)]@row = 1, "Blue",
IF([Schedule Variance]@row >= 0, "Green",

IF(AND([Schedule Variance]@row = 0,[Progress Status]@row = "Not Started"), "Not Started",

IF([Schedule Variance]@row <= -7, "Red", "Yellow")
```

Can you please try this one.

We can merge your Green condition using `>=`

Added missing parethesis for the AND function.

...

• ✭✭✭
Options

I am Still Receiving a Green Symbol Instead of "Not Started". Also I Merged The Greater Than = To

• ✭✭✭✭✭
Options

Hey @VirtixIT,

It looks like your IF/AND statement, if it returns true, isn't a color option for the circle. Also, because you put the AND after the IF([Schedule Variance]@row = 0, "Green"), the formula is going to process that condition before the AND statement. Try this:

`=IF([% Complete (Actual)]@row = 1, "Blue", IF(AND([Schedule Variance]@row = 0, [Progress Status]@row = "Not Started"), "Yellow", IF([Schedule Variance]@row >= 0, "Green", IF([Schedule Variance]@row <= -7, "Red", "Yellow"))))`

hope this helps!

If my response was helpful in any way (or answered your question) please be sure to upvote it, mark it as awesome, or mark it as the accepted answer!

I'm always looking to connect with other industry professionals, feel free to connect with me on LinkedIn as well!

• ✭✭✭