How to calculate the value in the Input Table widget?

  • karboski
    Asked on June 28, 2024 at 3:31 PM

    I've created a 4x5 table with dropdown responses (Y/N) in each cell. I'd like to perform a calculation based on if a Yes or No is in each table cell. What's the best way ?

  • Gian_D JotForm Support
    Replied on June 28, 2024 at 4:21 PM

    Hi James,

    Thanks for reaching out to Jotform Support. I understand what you’d like to do, but I’ll need a bit of time to work out a solution. I’ll get back to you shortly.

  • Gian_D JotForm Support
    Replied on June 28, 2024 at 7:43 PM

    Hi James,

    I saw that you're trying to calculate each cell in your Input Table widget, and using the Form Calculation widget, which is the best way to calculate each cell and display the result at the same time. But, one thing I saw is that you're using the dropdown input type as you mentioned to dictate "yes" or "no" answer, so I think you want to calculate the cell only if the user selected "yes." Although our system won't recognize the "yes" option to add a value for your calculation, as a workaround, you can use a checkbox input type instead to indicate that the cell needs to be added to the calculation as the checkbox and radio button are the only acceptable input types for calculation. I've cloned our form, and made the changes to demonstrate its functionality. Check out the screencast below:

    How to calculate the value in the Input Table widget? Image 1 Screenshot 50

    As you can see, I was able to calculate the total value of the Input Table widget depending on the number of cells selected on it. You can clone my demo form to make things easier, or you can do it on your end. Let me show you how to do it:

    First, let's change the input type of your Input Table widget:

    1. In Form Builder, click on the Gear icon of your Input Table widget, and click on the Fields tab.
    2. In Input Type section, click on Checkbox.

    How to calculate the value in the Input Table widget? Image 2 Screenshot 61

    Now, let's finish your formula in the Form Calculation widget:

    1. Click on the Wand icon of your Form Calculation widget.

    How to calculate the value in the Input Table widget? Image 3 Screenshot 72

    2. Copy the Form Calculation widget settings below:

    How to calculate the value in the Input Table widget? Image 4 Screenshot 83

    That's it. Let us know if you have any other questions.

 
Your Answer