Skip to main content

Using an IF statement to cap given number in a field

  • July 25, 2022
  • 1 reply
  • 9 views

I’m trying to link multiple fields together and cap the number depending on another field’s selection.

For example:

Currently I have this formula working as intended in the a field:

{X field} / WORKDAY_DIFF({Y Date}, {Z DATE})

I want to add a quantifier on top of that will determine the number it puts out.

So, if field A=B, cap the number at 2
If field A=C, cap the number at 1.

1 reply

Kamille_Parks11
Forum|alt.badge.img+27

Try the following:

MIN(
  IF({Field A} = "B", 2, 1),
  ({X field} / WORKDAY_DIFF({Y Date}, {Z DATE}))
)

That will take your original calculation and insert it if its less than either 1 or 2 (depending on Field A}'s value). If it its higher than that number, your cap number will be shown instead.