Syntax Error for IF on Text Formula

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

This does not work:

If(
([Category]="Fuel for Jobs"), "$1,500.00",
([Category]="Blueprints and Reproduction"), "$30.00",
([Category]="Advertising Expense"), "$200.00",
([Category]="Inventory Expense"), "$50.00",
([Category]="Tools and Machinery under $500"), "$100.00",
([Category]="Building Repairs"), "$150.00",
([Category]="Computer Repairs"), "$180.00",
([Category]="Equipment Repairs Other"), "$1,000.00",
([Category]="Training and Conferences"), "$165.00",
([Category]="Meals and Entertainment Outside"), "$35.00",
([Category]="Meals and Entertainment Inside"), "$35.00",
([Category]="Meals and Entertainment Birthday Lunch"), "$110.00",
([Category]="Officer Meals and Entertainment"), "$70.00",
([Category]="Repairs and Maintenance Other"), "$1,000.00",
([Category]="Computer Supplies Equipment"), "$150.00",
([Category]="Office Supplies"), "$550.00",
([Category]="Office Equipment under $500"), "$100.00",
([Category]="Postage and Delivery"), "$150.00",
([Category]="Shop Supplies"), "$200.00",
  )

Photo of Suzanne

Suzanne

  • 10 Points

Posted 3 years ago

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

QuickBaseCoach App Dev./Training, Champion

  • 67,780 Points 50k badge 2x thumb
To fix your formula it would look like



If(
[Category]="Fuel for Jobs", "$1,500.00",
[Category]="Blueprints and Reproduction", "$30.00",
[Category]="Advertising Expense", "$200.00",



etc


[Category]="Shop Supplies", "$200.00")



You could also shorten the formula by Using a Case Statement

Case([Category]

"Fuel for Jobs", "$1,500.00",
"Blueprints and Reproduction", "$30.00",
"Advertising Expense", "$200.00",

etc

"Shop Supplies", "$200.00")
Photo of Suzanne

Suzanne

  • 10 Points
Thanks for your help but neither one of those solutions worked. Still getting the syntax error.  Any other ideas?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,780 Points 50k badge 2x thumb
please post your current formula
Photo of Suzanne

Suzanne

  • 10 Points
Case([[Category]

"Fuel for Jobs", "$1,500.00",
"Blueprints and Reproduction", "$30.00",
"Advertising Expense", "$200.00",
"Inventory Expense", "$50.00",
"Tools and Machinery under $500", "$100.00",
"Building Repairs", "$150.00",
"Computer Repairs", "$180.00",
"Equipment Repairs Other", "$1,000.00",
"Training and Conferences", "$165.00",
"Meals and Entertainment Outside", "$35.00",
"Meals and Entertainment Inside", "$35.00",
"Meals and Entertainment Birthday Lunch", "$110.00",
"Officer Meals and Entertainment", "$70.00",
"Repairs and Maintenance Other", "$1,000.00",
"Computer Supplies Equipment", "$150.00",
"Office Supplies", "$550.00",
"Office Equipment under $500", "$100.00",
"Postage and Delivery", "$150.00",
"Shop Supplies", "$200.00"
)
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,780 Points 50k badge 2x thumb
Sorry, remove the double [[ before the word category

should be just single [

Case([Category]

I corrected my Answer
Photo of Suzanne

Suzanne

  • 10 Points
I thought the two [[ may have been a typo so I already tried it with only one [.  Still get the error.
Photo of QuickBasePros_IDS

QuickBasePros_IDS, Champion

  • 4,208 Points 4k badge 2x thumb
You're missing a comma after [Category] in the first line
Photo of Suzanne

Suzanne

  • 10 Points
That's it!  Thank you verrrrrrrrrrry much!!!