Forum Discussion

MarkComish's avatar
MarkComish
Qrew Assistant Captain
7 years ago

Formula help

I need an If formula for the following...

If [field1] is equal to "CCO" then [field2]*.52
If [field1] is equal to "ASG-F" then [field2]*.20 
If [field1] is equal to "ASG-K" then [field2]*.80 
else [field2] is 0 or blank

Sorry but I am terrible at figuring out formula structures :-(
  • Because you are testing the same field and there are no other conditions, you can use CASE.

    Case([field1],
    "CCO", [field2]*.52,
    "ASG-F", [field2]*.20,
    "ASG-K", [field2]* .80)

    The formula above will calculate to null if the above conditions are not met. A null is different than a zero.

    If you do want the result to be a zero if the conditions are not met then use

    Case([field1],
    "CCO", [field2]*.52,
    "ASG-F", [field2]*.20,
    "ASG-K", [field2]* .80,0)