How to create an IF statement like in a list

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • In Progress
I need to say if ([Status]= "smith" or 'George" or "brown", last name, first name)
Photo of cowannbell

cowannbell

  • 680 Points 500 badge 2x thumb

Posted 1 year ago

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

QuickBaseCoach App Dev./Training, Champion

  • 51,306 Points 50k badge 2x thumb
Here is a link to formula help
https://login.quickbase.com/db/6ewwzuuj?a=q&qid=1000080

Here is the help for the IF https://login.quickbase.com/db/6ewwzuuj?a=dr&r=cm&rl=dvn

In your example since you are testing against just 1 field you can also use the Case function

https://login.quickbase.com/db/6ewwzuuj?a=dr&r=ei&rl=dvy
Photo of cowannbell

cowannbell

  • 680 Points 500 badge 2x thumb

I had already looked at all of the If statements and didn't find one that would work in my situation.  I had used one that works in excel using the If(OR but I kept getting syntax errors.  I just used case and this is my formula

Case([Status],"Contracted",Contracted,"Contracted Extend",Contracted,"Location Contracted",Contracted,"Location Contracted Extend",Contracted,[Status])

I am getting a this error.

Formula syntax error

The argument list of the function Contracted must begin with a left parenthesis.


Case

Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,306 Points 50k badge 2x thumb
Try this

I suggest a vertical format for readability


Case([Status],
"Contracted","Contracted",
"Contracted Extend","Contracted",
"Location Contracted","Contracted",
"Location Contracted Extend","Contracted",
    [Status])
Photo of cowannbell

cowannbell

  • 680 Points 500 badge 2x thumb

Well, the issue was that I didn't have "" around the 2nd part of each.  The formula I looked at didn't have them, so I assumed they were not suppose to be there but when I used them they work.