How to accurately Calculate Age?

  • Profile Image
    Asked on August 19, 2018 at 07:21 PM

    I have seen answers for this in a significant amount of other threads using the Form Calculation widget on the Jotform forum, but I don't think they actually work.

    1. The Round function doesn't seem to work... someone 8 years and 7 months old is rounded to 9 years old.
    2. If you don't use the Round function and leave the decimal places to 0, it rounds anyway.
    3. It's technically 365.25 days per year.
    4. Even that doesn't help because it assumes exactly 365.25 days in every single year. Whether that is accurate or not depends on exactly what year you start and end with, as leap year adds one day every four years, not .25 of a day every year.

    Please correct me if I'm wrong, I'm by no means God's gift to mathematicians. However, after trying several dates, I think I'm correct.

    If I am correct, is there an accurate way to calculate age? It is easily done in a spreadsheet, so if it would be possible to somehow link a field calculation from a spreadsheet this would be doable, but I don't know if that's possible.

  • Profile Image
    Answered on August 20, 2018 at 12:22 AM

    Unfortunately we do not have any built-in feature to calculate age. The only possibility for now is to add date field in form and take advantage of your form calculation widget to calculate age based on the date difference. Here are the steps you need to follow:

    #1. Add a hidden date field in your form and hide it. You need to configure it to display current date.

    #2. Add another date field which users will use to select data of birth.

    #3. Add "Form Calculation" widget in form and add the above formula to calculate age. Please check the screenshot below:


    I would suggest you to please take a look at the following form and see if this is what you wanted to achieve: 

    Feel free to clone this form for a closer look. The following guide should help you in form cloning: