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

  • Profile Image
    iwsmith
    Asked on April 07, 2017 at 10:09 AM

    how can i calculate an age based upon a DOB entered

  • Profile Image
    Jim_R
    Answered on April 07, 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 

  • Profile Image
    iwsmith
    Answered on April 07, 2017 at 03:44 PM
    Thanks I figured it out ☺
    ...