Forum Discussion

ZintJoseph's avatar
ZintJoseph
Qrew Captain
8 years ago

When to use Case or IF statement to test for multiple conditions

I have a drop down that I am trying to test for multiple conditions. I have tried both an If and Case statement but keep getting errors...

This is what I have at this point and it still is kicking back syntax errors. I will have another condition to setup after this one but I think if I get this one figured out the other will work as well

Case([Est Month To Close],
"April",Q1,
"May",Q1,
"June",Q1,
"July",Q2,
"August",Q2,
"September",Q2,
"October",Q3,
"November",Q3,
"December",Q3,
"January",Q3,
"February",Q4,
"March",Q4,
)

Thanks in advance for the help
  • Joey, you will need quotes around the results the Q1 etc needs to be "Q1"

    e.g.
    "April","Q1",
  • Tried that, still get a syntax error

    Please check the syntax of your formula. Look for mismatched parentheses, missing quotes, or extra brackets


    Case([Est Month To Close],
    "April","Q1",
    "May","Q1",
    "June","Q1",
    "July","Q2",
    "August","Q2",
    "September","Q2",
    "October","Q3",
    "November","Q3",
    "December","Q3",
    "January","Q3",
    "February","Q4",
    "March","Q4",
      )
  • That very last comma needs to be removed as there is no next condition to evaluate after March.

    "March","Q4"
      )
  • Lol, that did it....that pesky comma...I have looked for that type of mistake about 6 times and missed it every time.