Skip to main content
Question

Multiple conditions formula to generate cost field

  • July 26, 2019
  • 0 replies
  • 22 views

I am looking to generate a cost field for "freight" where its based on miles away. 

If (([Miles]>0 but <=150), "$450. ([Miles]>150 but <=200), "$600")

I am unsure if an "IF" formula works in this case or what Function I need to use. 
This topic has been closed for replies.

If (
[Miles]>    0 and [Miles  <= 150, "$450,
[Miles]>150 and [Miles] <= 200, "$600",

.. then a value for when Miles is > 200)


  • Author
  • Registered
  • July 26, 2019
Perfect, that works great. 

Thanks for the quick reply as always Mark.

This can be done in a Case statement.  The formula stops when the first match is found.  Try something like this:


Case(True,
  [Miles]<=0, 0,
  [Miles]<=150, 450,
  [Miles]<=200, 600,
  0
)

The last zero is what's returned if nothing else matches.  (You didn't specify what should happen if miles > 200.)