I have a DOB box in my form. Is it possible to auto-calculate age?

  • adminocrda
    Asked on March 16, 2021 at 9:51 AM

    Is there a way to make the submission show the DOB and convert that into the end user's age at submission please? I have the DOB box in my form, but can't work out the rest.

    Thanks

  • roneet
    Replied on March 16, 2021 at 12:02 PM

    You can calculate the Age this way:

    1615910365 6050d5dda3d4d  Screenshot 10

    You can add a Form Calculation widget and then calculate the difference between the current and Birthdate field.

    You need to add another Date Picker widget and calculate the current date.

    Let us know the form where you want to insert the logic?

    Thanks.

  • adminocrda
    Replied on March 16, 2021 at 2:06 PM

    Thank you!. I've replicated what you have shown, except the word floor as I can't work out what that would be in my form. It is currently looking to be 6 months adrift and calculating me to be 6 months older than I am.


    My form is: https://form.jotform.com/adminocrda/Under18LicenceApplication2021


    Thanks for your help!

  • Kevin Support Team Lead
    Replied on March 16, 2021 at 7:57 PM

    The floor function needs to be added through the widget, kindly check this guide for more details: https://www.jotform.com/help/267-form-calculation-math-function-reference

    If you have any questions, let us know.

    Thanks.

  • adminocrda
    Replied on March 17, 2021 at 1:27 PM

    Good Afternoon

    My condition is now set exactly as the one you have provided, including floor, but it is still calculating me to be older than I am. So it is now rounding down to a whole year, but the calculation is a year over what it should be.


    Thanks

  • adminocrda
    Replied on March 17, 2021 at 1:34 PM

    I've found the issue. After much googling to find the actual calculation and not an excel formula, the last part of what you sent me needs to be 365.2422 Those 2 x 2s are very important it seems!


    Thanks for your help