How Do I Calculate the Average (Mean) Result of Any Number of Inputs?

  • AneeshRylands
    Asked on July 30, 2015 at 6:44 AM

    I need to calculate an average result. 

    i want to sum the contents of about ten fields and the divide that result by the number of those fields that is actually filled in. 

     

  • abajan Jotform Support
    Replied on July 30, 2015 at 9:34 AM

    Here's a jotform illustrating the desired functionality. This example uses Number fields

    How Do I Calculate the Average (Mean) Result of Any Number of Inputs? Image 1 Screenshot 30

    which by their very nature restrict users to entering just numbers but other field types like regular text boxes, drop downs and radio buttons can also be used.

    The demo also has a Form Calculation widget. If you clone the form and examine the work area of the widget, you'll see the following expression:

    How Do I Calculate the Average (Mean) Result of Any Number of Inputs? Image 2 Screenshot 41

    (The Add Field button is used to insert the tag for the field.)

    If you need more help with this, please let us know.

    Cheers

  • abajan Jotform Support
    Replied on July 30, 2015 at 10:13 AM

    I should add that it's possible to assign numeric values to non-numeric options of drop down and radio button fields by going into their properties:

    How Do I Calculate the Average (Mean) Result of Any Number of Inputs? Image 1 Screenshot 30

    and entering the values in the Calculation Values field. By default, drop downs have a blank selection for which a value, even if it's 0, must be included:

    How Do I Calculate the Average (Mean) Result of Any Number of Inputs? Image 2 Screenshot 41


    Thanks