IF Calculations to display text from Numbers

Tap Forms – Organizer Database App for Mac, iPhone, and iPad Forums Using Tap Forms IF Calculations to display text from Numbers

Viewing 3 reply threads
  • Author
    Posts
  • February 20, 2018 at 4:46 AM #27428

    Michael Dandeo
    Participant

    I love tap forms! for what I’m using it for, it works GREAT. Now I’ve got some basic forms completed, im slowly going back and customizing and trying to find new ways to display data. But im stuck in a few areas (mainly calculations). Maybe im stuck in Excel thinking or I need to view the problem from another angle.

    I am trying to build a calculation to display a text string from a number in another field. IF doesn’t seem to want to display text, am I doing this wrong?

    – I have a Table field with 5 data Columns (numbers) and a 6th column to SUM all the columns together. In a number field I am trying to turn that SUM from the table field into Text such as “High, Low”. My wife is also interested in doing this for a form she is using as a grade book for private tutoring.

    – This is an example of what I’m trying to do but can’t seem to it make work.
    IF([FEILD]<11,”Low”)
    Result Type? Text,Number? I’ve tried both

    Ultimately I would like to have nested IF Functions to display text for numbers ranging from 1-100. But my syntax seems to be wrong with a basic IF function and can’t figure out how to start.

    Any help would be much appreciated. Ive only been using Tap Forms for a few weeks and Im still experimenting and exploring…. Thank you

    February 20, 2018 at 12:39 PM #27429

    Brendan
    Keymaster

    Hi Michael,

    I’m glad you’re loving Tap Forms!

    You’re very close. What you want to do in your IF statement is to provide a value for the “else” clause.

    The full syntax of the IF statement is this:

    IF(condition; then; else)

    So to be valid, you must provide 3 parameters. The first parameter, condition, must evaluate to true or false, but it must also be a numeric comparison. The then parameter can be text or numeric. The else parameter can also be text or numeric.

    So in your case, try this:

    IF([Field] < 11; "Low"; "High")

    So in one condition you return “Low” if the value of Field is less than 11 or High if it’s greater than or equal to 11.

    If you need to compare equality of textual data, use the IFEQUAL(A; B; C; D) function instead. A & B must be text, but C and D can be text or numeric values. The above function says “If A and B are equal, then return C, otherwise if A and B are NOT equal, return D”.

    Hope that makes sense!

    Brendan

    February 21, 2018 at 8:39 PM #27433

    Michael Dandeo
    Participant

    That worked!! Thank you for the help, I really do appreciate it.

    I think syntax is what really got me. I didn’t expect to need a space after [Field] or “else” clause. And I was assuming I would get a “False” if my formula didn’t run properly.

    Again thank you. that one little piece of info solved a lot of questions for me.

    February 21, 2018 at 8:57 PM #27434

    Brendan
    Keymaster

    Hi Michael,

    The space shouldn’t be an issue. But the problem with your expression was you were passing 2 parameters into a function that requires 3 parameters. I just like to put spaces in to make them easier to read.

Viewing 3 reply threads

You must be logged in to reply to this topic.