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

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered
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
Photo of Joey Zint

Joey Zint

  • 1,508 Points 1k badge 2x thumb

Posted 1 year ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 53,038 Points 50k badge 2x thumb
Joey, you will need quotes around the results the Q1 etc needs to be "Q1"

e.g.
"April","Q1",
Photo of Joey Zint

Joey Zint

  • 1,508 Points 1k badge 2x thumb
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",
  )
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 53,038 Points 50k badge 2x thumb
That very last comma needs to be removed as there is no next condition to evaluate after March.

"March","Q4"
  )
Photo of Joey Zint

Joey Zint

  • 1,508 Points 1k badge 2x thumb
Lol, that did it....that pesky comma...I have looked for that type of mistake about 6 times and missed it every time.