I need help with a formula please

Tagged: 

Viewing 1 reply thread
  • Author
    Posts
  • July 25, 2019 at 5:51 AM #36046

    D J Leason
    Participant

    Anybody know how to write this in Tap Forms?
    IF(Cups<=2,”Pint”,IF(Cups <=4,”Quart”,IF(Cups<=8,”HALF GALLON”,IF(Cups<=16, “Gallon”))))

    July 25, 2019 at 11:19 AM #36047

    Brendan
    Keymaster

    Hi DJ,

    That looks almost right except for a few things.

    1. Use semi-colons between the expressions. And make sure you use straight quotes, not curly quotes.

    2. And if you’re building this on iOS, make sure the field names have square brackets around them. If on macOS, then just double-clicking on the field will insert the field “pill” button automatically.

    3. You’re missing the Else condition in the final expression.

    IF([Cups] <= 2; "PINT";
    IF([Cups] <= 4; "Quart"; 
    IF([Cups] <= 8; "Half Gallon";
    IF([Cups] <= 16; "Gallon"; "Unknown"))))

    You could also return the empty string "" other than Unknown if you like. Then nothing will display there when you haven’t provided a value or if it’s greater than 16.

Viewing 1 reply thread

You must be logged in to reply to this topic.