# Switch Formula

Options

Hello,

I have recently integrated a project plan from MS plan to Smartsheet's however I can't seem to get the auto RAG Switch function working working as it was in Project Plan. This is the formula I used. Can anyone please help :)

```Switch(
([% Complete] = 100), "C",
([Baseline Finish] < Now()), "R",
([Finish] > [Baseline Finish]), "A",
([Finish] <= [Baseline Finish]), "G",
True, "ERROR!"
)
```

• ✭✭✭✭✭✭
Options

There is no SWITCH function in Smartsheet. Use nested IF to achieve the same.

• Options

Thanks for the contribution Sameer, I've tried using IF but it is not working. Do you happen to know how the formula would be set out to achieve the same result please? or anyone else?

• ✭✭✭✭✭✭
edited 02/23/22
Options

See if this works,

```= IFERROR(
IF([% Complete]@row = 100, "C",
IF([Baseline Finish]@row < TODAY(), "R",
IF([Finish]@row > [Baseline Finish]@row, "A", "G")
)
), "ERROR!")
```
• Options

Still not working and says inseparable.

I'd also like to use symbols: Red, Yellow, Green, Blue

Blue being complete

= IFERROR(IF([% Complete]@row) = 100, "C", IF([Baseline Finish]@row) < TODAY(), "R", IF([Actual Finish]@row) > [Baseline Finish]@row, "A", "G"))),"ERROR!")

• edited 02/24/22
Options
• ✭✭✭✭✭✭
Options

Try something like this.

```=
IFERROR(IF([% Complete]@row) = 1, "Blue",
IF([Baseline Finish]@row) < TODAY(), "Red",
IF([Actual Finish]@row) > [Baseline Finish]@row, "Yellow", "Green"))),"ERROR!")
```

Did that work/help?

I hope that helps!

Be safe and have a fantastic weekend!

Best,

Andrée Starå | Workflow Consultant / CEO @ WORK BOLD

Did my post(s) help or answer your question or solve your problem? Please support the Community by marking it Insightful/Vote Up or/and as the accepted answer. It will make it easier for others to find a solution or help to answer!

SMARTSHEET EXPERT CONSULTANT & PARTNER

Andrée Starå | Workflow Consultant / CEO @ WORK BOLD

W: www.workbold.com | E:andree@workbold.com | P: +46 (0) - 72 - 510 99 35

Feel free to contact me for help with Smartsheet, integrations, general workflow advice, or anything else.

• Options

Hi thank you for your contribution. It comes back saying #UNPARSEABLE?

• ✭✭✭✭✭✭
edited 02/25/22
Options

Happy to help!

Try this instead. (I noticed some errors + I modified it a little)

```=
IFERROR(IF([% Complete]@row = 1, "Blue",
IF(AND([Baseline Finish]@row < TODAY(), [Baseline Finish]@row <> ""), "Red",
IF([Actual Finish]@row > [Baseline Finish]@row, "Yellow", "Green"))), "ERROR!")
```

Did that work?

Remember! Did my post(s) help or answer your question or solve your problem? Please support the Community by marking it Insightful/Vote Up or/and as the accepted answer. It will make it easier for others to find a solution or help to answer!

SMARTSHEET EXPERT CONSULTANT & PARTNER

Andrée Starå | Workflow Consultant / CEO @ WORK BOLD

W: www.workbold.com | E:andree@workbold.com | P: +46 (0) - 72 - 510 99 35

Feel free to contact me for help with Smartsheet, integrations, general workflow advice, or anything else.

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!