Forum Discussion

NicoleVarner's avatar
NicoleVarner
Qrew Member
5 years ago

If statement using numeric formula fields.

I am trying to create a Text Formula field that will pull information from three different numeric formula fields. If 1st one is not equal to null, pull the information from 1st field, if the 2nd one is not equal to null, pull the information from 2nd field, if 3rd one is not equal to null, pull information from the 3rd field.  I keep getting an error message "Expecting text but found number".  Is there a way to do an If statement using numeric formula fields?

------------------------------
Nicole Varner
------------------------------
  • PaulPeterson1's avatar
    PaulPeterson1
    Qrew Assistant Captain
    Try something like this:

    If(not IsNull([Field 1]), [Field 1], not IsNull([Field 2]), [Field 2], not IsNull([Field 3]), [Field 3])

    ------------------------------
    Paul Peterson
    ------------------------------
    • PaulPeterson1's avatar
      PaulPeterson1
      Qrew Assistant Captain
      Amended, since you want to display text:

      If(not IsNull([Field 1]), Text 1, not IsNull([Field 2]), Text 2, not IsNull([Field 3]), Text 3)

      Obviously the Text 1, 2 and 3 are just placeholders.  You can either enter the text inline or define variables and use them in the formula.

      ------------------------------
      Paul Peterson
      ------------------------------
    • NicoleVarner's avatar
      NicoleVarner
      Qrew Member
      Thank you! This works perfectly!

      ------------------------------
      Nicole Varner
      ------------------------------