Conditional formula for an exact form

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered

I am trying to create a fomula field in Quickbase with and If statement so that I can just stick that form on the Exact form. I am just not good at formulas in general.

This is basically what I am trying to say:

If the option chosen in Ship To2 is "Shop", Display the result in field " [Shop Address2]"

The formula I have, which is obviously not working is below. Can someone please tell me what I have to do to get this to work? 

Thank you! 

If(

[Ship To2]="Shop" ," [Shop Address2]",

[Ship To2]="Project","[Project – Location]",

[Ship To2]="Customer","[Project - Customer - Address] ",

[Ship To2]="Other”, “[Address]")

Photo of Amanda

Amanda

  • 10 Points

Posted 4 years ago

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

QuickBaseCoach App Dev./Training, Champion

  • 65,168 Points 50k badge 2x thumb
Try this

If(

[Ship To2]="Shop" ,[Shop Address2],

[Ship To2]="Project",[Project – Location],

[Ship To2]="Customer",[Project - Customer - Address],

[Ship To2]="Other”, [Address])



You do not use the quotes if you are referring to a field.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,024 Points 20k badge 2x thumb
Use a Case() statement instead of and If() statement when you are testing one field against a number of different values:

Case([Ship To2],
  "Shop", [Shop Address2],
  "Project", [Project – Location],
  "Customer", [Project - Customer - Address] ,
  "Other”, [Address]
)
Photo of Amanda

Amanda

  • 10 Points
I was able to get both of these to work. Thank you both for a quick response!