Help

Re: Using an IF statement to cap given number in a field

451 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Darren_DuHadawa
4 - Data Explorer
4 - Data Explorer

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 1

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.