Calculating the number of entries in an input table

  • RonFriedman
    Asked on February 25, 2021 at 3:04 PM

    I'm trying to count the number of entries in a row in an input table. I've tried 3 versions:

    1. Assigned the week numbers (rows) a value in the option table then tried to count the weeks
    2. Did not assign a value and as it is a checklist thought it may be Boolean issue and would count if it's checked
    3. switched my rows and columns as the Count() function says it counts rows.

    Nothing is working :(



    Jotform Thread 2926197 Screenshot
  • Kevin Support Team Lead
    Replied on February 25, 2021 at 10:53 PM

    The easiest way is to do the following:

    • Assign calculation values to each option in the table, you need to assign 1, you can do this through the field settings:

    1614311538 60387072ea491  Screenshot 10

    • Then add all the fields to the Form Calculation widget and sum the values, here is an example:

    1614311592 603870a882fe4  Screenshot 21

    This will show a counter of selected options, here is a cloned form where you can see how it works: https://form.jotform.com/210559109748967

    I hope this helps.

  • RonFriedman
    Replied on February 26, 2021 at 12:55 PM

    This is still not working. Your answer is the same as https://www.jotform.com/help/343-how-to-perform-form-calculation-in-the-input-table-field which I tried. I'm trying to count the number of sign ups for week1. The number of signups for week 2 etc. Those fields will be hidden from my form, but they will be important for me post analysis so I know how many kids are signed up for each week of camp.

    I'm using the sub-matrix selection and for week 1 only choose the row of week 1. Similarly for week 2 I only choose week 2. Instead of input value being 1,2,3,4,5,6 I actually think I would be better with 1 on all as it is a count. For week 2-4 I have to divide the total by 4. That said - none of my rows are working. Not sure why...

    https://www.jotform.com/build/210554796263057/publish. current form

  • Kevin Support Team Lead
    Replied on February 26, 2021 at 3:54 PM

    The calculations don't work due to the logic implemented, note that the same math logic applies for this widget and your formula has an extra plus sign at the very end which doesn't sum with any values:

    1614372641 60395f2190a87  Screenshot 10

    Now, after correcting this the calculation must be working as expected. Also, if your purpose is to only check the number of selected options, you need to indeed set 1 as calculation values to all the fields, this means that it's not needed to set a different number to the second row, you can set 1 to all the rows and columns and then simply perform the sum.

    Please apply the corrections and test your form again, here is my cloned form with the changes applied, you can clone it and check how I modified the calculation: https://form.jotform.com/210565931373961


  • RonFriedman
    Replied on February 28, 2021 at 11:21 AM

    works great. thanks! I thought I had tried that combo at least 3 times but I guess when you keep trying versions always one part of the combination is off