How can I calculate the age based on Date of Birth entered?

  • iwsmith
    Asked on April 7, 2017 at 10:09 AM

    how can i calculate an age based upon a DOB entered

  • Support_Management Jotform Support
    Replied on April 7, 2017 at 12:26 PM

    Although we don't have an innate feature like this, you can still achieve the same goal by using the Form Calculation Widget.

    Related guide: How-to-Add-a-Widget-to-your-Form 

    For this, you'd need to use the floor() function to get the base result in case there are decimal places since age is always a whole number.

    Your general formula would be:

    floor ((TODAY - DOB) / 365.25)

    1. Add a Date Picker field where the respondent can enter his DOB

    2. Add a 2nd Date Picker that will be hidden and will always show Today's date

    3. Add the Form Calculation widget

    4. Click the ... 3-dotted menu to add the floor() function

    5. Then complete the formula as shown above

    Result: https://www.jotform.com/70964408638971 

    How can I calculate the age based on Date of Birth entered? Image 1 Screenshot 20

  • iwsmith
    Replied on April 7, 2017 at 3:44 PM
    Thanks I figured it out ☺
    ...