How can the form automatically calculate age?

  • V_S
    Asked on February 14, 2019 at 10:07 PM

    Can the form automatically calculate age?

    For example, in my form I am asking the participant for age, and the next question is age in Months. Can the age in months get populated automatically based on background calculation?

    Q. What is you birth date?

    Q What is your age in months?

    Thanks

  • BJoanna
    Replied on February 15, 2019 at 2:18 AM

    Yes, a form can automatically calculate age and months. This can be achieved with the Date Picker field and Form Calculation widget. 

    How to Perform Form Calculation Using a Widget

    Mastering Date and Time Calculation

    You can check the following template - https://www.jotform.com/form-templates/calculate-age


    You will have to add two Date Picker fields to your form. The first to ask the birth date and the second to show the current date. 

    After that, you should calculate the day difference. 

    1550214296date1 Screenshot 10

    Then you can use the following formulas to calculate years and months.

    For years/ age.

    1550214348date2 Screenshot 21

    For months.

    1550214440date3 Screenshot 32

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

    Feel free to test it and clone it.