Input table: Calculations to include negative values

  • HBSPASS
    Asked on June 20, 2018 at 10:25 AM

    Hi Jotform Team,


    In this case I have a Form that requires an Input table and the input table values could both be positive for a Saving and negative for a Cost. How can I set up the calculated fields such that a negative value is automatically subtracted from the positive values and in the event of a negative value being the total?


    Any help on this would be greatly appreciated as this would really help our form become fully interactive without the need for a second complimentary table to accommodate for negative values.


    Best regards,

    Anthony, HBS PASS

    Jotform Thread 1504135 Screenshot
  • Richie JotForm Support
    Replied on June 20, 2018 at 11:51 AM

    To clarify, you want to have a table that would automatically calculate either + or - values to the next box?

    Unfortunately,there is no way to dynamically set the calculation depending on its values. We need to set the calculations in the Input table.

    Input table: Calculations to include negative values Image 1 Screenshot 40

    Although we can set a condition to use subtraction if the value contains "-",however, we cannot determine which input it would be coming from.

    Input table: Calculations to include negative values Image 2 Screenshot 51

    Guide:https://www.jotform.com/help/414-Calculate-Values-in-the-Input-Table-Through-Condition

    Here is a sample screen cast:

    Input table: Calculations to include negative values Image 3 Screenshot 62

    Sample Form:https://form.jotform.com/81704224297962

    Feel free to clone it:https://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL

    Hope this information helps.

    Please let us know if you have further questions.

    Thank you.

  • HBSPASS
    Replied on June 21, 2018 at 3:53 AM

    Hi Richie,


    Thank you for your speedy response, the problem I'm having is any cell in the input table could be a positive or negative value and based on it's mathematical operator, such as a "-", it defaults the cells calculation to that operator. The methodology here is very much like an Excel Spreadsheet I suppose, but the input table is the best tool for a form of this type.

    Can I make a suggestion that this could be implemented to the Input Table to enable such a feature for future prospects on Jotform Forms and their respective dynamic interactivity? 

    I will try the conditional method you have advised above and again I am very greatly for your input.

    Best regards,

    Anthony, HBS PASS

  • BJoanna
    Replied on June 21, 2018 at 7:16 AM

    I am not exactly sure if I understood your question correctly, but you can enter a positive or negative value inside of the Input Table field and perform a calculation with conditional logic.

    1529579389inputtable1 Screenshot 10

    Here is a demo form -  https://form.jotform.com/81712574951966 

    Feel free to test it and clone it

    If you want to achieve something else, please provide us an example. 

    I would also suggest you to check available Math Functions:

    Form Calculation - Math Function Reference

    We also have the Spreadsheet widget that you can use to perform the calculation.