Discussions

Expand all | Collapse all

If statement using numeric formula fields.

  • 1.  If statement using numeric formula fields.

    Posted 21 days ago
    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
    ------------------------------


  • 2.  RE: If statement using numeric formula fields.

    Posted 21 days ago
    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
    ------------------------------



  • 3.  RE: If statement using numeric formula fields.

    Posted 21 days ago
    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
    ------------------------------



  • 4.  RE: If statement using numeric formula fields.

    Posted 20 days ago
    Thank you! This works perfectly!

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