Nested IF or SWITCH statement in formulae

  • Profile Image
    tagdev
    Asked on February 08, 2021 at 01:02 PM

    Hi

    We want to have an "advanced formula" column a in Jotform table, which tests the numerical values in another column against two constants A and B (where B is greater than A), to give a result which returns one of 3 possible states, showing whether the column values are (i) less than A, OR (ii) between A and B OR (iii) greater than B.

    Can you advise how to do this - we have not had much luck in using nested IF statements, and can find no documentation on how the SWITCH statement is supposed to work.

    Thanks in advance...

  • Profile Image
    Sonnyfer
    Answered on February 08, 2021 at 04:30 PM

    Hi there - It seems the Nested IF formula isn't configured yet as per this ticket. Allow us to forward your ticket as well to our developers to check maybe your case is different. But first, could you please provide more information about what you're trying to achieve? We'll try to do it first on our end. A screenshot of the formulas would also help.

    Guide: How-to-Post-Screenshots-to-Our-Support-Forum

  • Profile Image
    tagdev
    Answered on February 08, 2021 at 04:59 PM

    Hi

    Thanks for the reply. Don't have a screenshot, but suppose I have a column in my table with integers so:

    1
    3
    6
    4
    7

    I want a formula to work on these numbers to return, in a new column, one of the following strings: "2 or less", "between 3 and 5", "6 or more" so:

    "2 or less"
    "between 3 and 5"
    "6 or more"
    "between 3 and 5"
    "6 or more"

    If I can't use a nested IF to test the range each number falls into, can I use the SWITCH statement?

    Hope that's clear

    Thanks for the help...


  • Profile Image
    Sonnyfer
    Answered on February 08, 2021 at 06:09 PM

    Thanks for the additional information. Can you also share which of your forms you have these integers? I see you have at least 7 forms on your account.

    We look forward to your reply.

  • Profile Image
    tagdev
    Answered on February 09, 2021 at 05:25 AM

    My question is a general one on how to do a nested if.

    However, if you want a specific example from one of our forms, look at column "Age" in form "2021 Piping Competition: application form" - how do I produce a new Table column which contains, for example, one of "age under 18", "age 18 to 21", "age over 21" for each row based on the value in "Age"?

    Thanks


  • Profile Image
    Fernand
    Answered on February 09, 2021 at 07:50 AM

    Hello tagdev,

    Thanks for reaching us.

    Please give us more time to check your request. I will get back to you as soon as possible.

    Thanks for your patience.

  • Profile Image
    Fernand
    Answered on February 09, 2021 at 08:49 AM

    Hello tagdev,

    We are sorry for the late reply. Please check my screencast below:

    1612877947_6022907baa78a_screencast 2021

    Please notice that I have added the second IF function by clicking on the first False option. Here is also a screenshot of the formulas to show better

    1612878321_602291f18a725_Screen Shot 202

    Please have a check and let us know for further assistance.