Nested 3 IF() statements with 3 AND()

What is wrong with my nested if? It says that that It’s invalid

IF(
  AND(
    {5dayswithnochange},
    {issueStatus🟢or🔴or🟠}=🟢
  ), 
  "Stable ⚖", 
  IF(
    AND(
      {5dayswithnochange}, 
      {issueStatus🟢or🔴or🟠}=🟠
    ), 
    "Stuck 🆘", 
    IF(
      AND(
        {5dayswithnochange},
        {issueStatus🟢or🔴or🟠}=🔴
      ), 
      "Broken 🔥", 
      "Too soon to tell ❔"
    )
  )
)

nevermind, I forgot to add the quotes “” around the emojis :green_circle: in the equality evaluations
Correct code

IF(
  AND(
    {5dayswithnochange},
    {issueStatus🟢or🔴or🟠}="🟢"
  ), 
  "Stable ⚖", 
  IF(
    AND(
      {5dayswithnochange}, 
      {issueStatus🟢or🔴or🟠}="🟠"
    ), 
    "Stuck 🆘", 
    IF(
      AND(
        {5dayswithnochange},
        {issueStatus🟢or🔴or🟠}="🔴"
      ), 
      "Broken 🔥", 
      "Too soon to tell ❔"
    )
  )
)

Glad you were able to fix your issue yourself!

However, I happened to see your formula and thought you might be interested in a slightly simpler version. This version has less nesting and eliminates the need for the AND functions. It also uses the SWITCH function, which is really useful for when dealing with multiple possible values for a single field.

IF ({5dayswithnochange},
    SWITCH({issueStatus🟢or🔴or🟠},
      "🟢", "Stable ⚖", 
      "🟠", "Stuck 🆘", 
      "🔴", "Broken 🔥"
    ),
    "Too soon to tell ❔"
)
1 Like

Tank you! simpler syntax indeed.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.