How to count the number of selected check box options?

  • sagischwartz
    Asked on December 28, 2015 at 4:00 PM

    Hi,

    I created an order form, in which the client chooses meals for an entire week.

    I want a formula that will count how many lunch and how many dinners he ordered for the week.

    the user has an option for lunch and dinner every day, yet he doesn't have to choose every meal (for example he can order dinner for Sunday, lunch for Thursday etc.)

    I tried to do it using the conditions tool but nothing seemed to work

    is it possible?

    the form looks like this:

    How to count the number of selected check box options? Image 1 Screenshot 20

  • Jeanette JotForm Support
    Replied on December 28, 2015 at 6:59 PM

    I think that can be accomplish with form calculations http://www.jotform.com/help/259-How-to-perform-calculation-in-the-form

    Then you can assign values to the options:

    http://www.jotform.com/help/301-How-to-Assign-Calculation-Value

     

    This way everything will sum and make a total in the form.

     

     

  • sagischwartz
    Replied on December 29, 2015 at 1:14 AM

    But my calculation values are already the prices of the meals. 

    I want it to sum the meals - 3 dinner, 4 lunch etc

    Is there any other way?

     

  • BJoanna
    Replied on December 29, 2015 at 5:52 AM

    I have inspected your form and I saw that you have added calculation values to some of your check box fields and that you have form calculation field which is calculation values from check box fields. 

    However if you want to count how many lunch and dinner options are selected, then you can add additional form calculation fields to your form and use count option to count number of selected check box options. 

    How to count the number of selected check box options? Image 1 Screenshot 30

    How to count the number of selected check box options? Image 2 Screenshot 41

    Here is my demo form: https://form.jotform.com/53622063382956 

    Feel free to clone it.

    Hope this will help. Let us know if you need further assistance. 

  • sagischwartz
    Replied on December 29, 2015 at 8:29 AM

    This is very helpful! thank you

    but for some reason, when I do it on multiple fields it doest calculate right

    can you please check ? https://form.jotform.com/53623518467966

    How to count the number of selected check box options? Image 1 Screenshot 20

  • sagischwartz
    Replied on December 29, 2015 at 8:35 AM

    also, there are two delivery days so I want to separate the counting.

    when I duplicate the formula to count it for the second delivery, It counts the sum for some reason

     

    How to count the number of selected check box options? Image 1 Screenshot 20

  • BJoanna
    Replied on December 29, 2015 at 11:33 AM

    I have cloned and inspected form you provided and Count calculation option is working on your form.

    How to count the number of selected check box options? Image 1 Screenshot 20

    Also I saw that you have 4 fields that are calculating based on Count option and I saw that not all check box fields are included in calculation option. 

    Considering that your form is in Hebrew I am not sure if all fields are related to food and if they should be included in calculation.

    If you are still unable to set Count calculation option, please provide us names of ID's of the fields you want to calculate and we will try to set calculation for you. 

    Let us know if you need further assistance.