CALCULATE BIRTH DATE

  • Codyiwanow52
    Asked on February 27, 2021 at 9:38 PM

    Hey!

    I'd like to know how to convert the "Birth Date" column in my form

    I'd like it to calculate to how old the individual is

    Because Normally I would be able to export and do a format in excel, but it only exports with the months as below, not in numerical format. (see below and screen shot please)

    Example :

    January 1 1994

    Age : 27 Yrs Old


    Please Advise

    Thank you in advance

    Jotform Thread 2930902 Screenshot
  • Gaetan_B
    Replied on February 28, 2021 at 7:19 AM

    Hello,

    Thank you for reaching out.


    For this, you will 2 date fields (one for the birth date as you currently have), and one for the current date.

    To set the current date in a date field, you will have to Options in the Properties of the field(the little cogwheel), and put Default Date to Current.

    To hide this field (as it will have no use for the user), you can then click on Advanced and toggle on Hide field.

    1614514168 603b87f82243b  Screenshot 10


    Once this is done, you can add a Short Text field for example, which will receive the result of the calculation we will make.

    1614514344 603b88a84585a  Screenshot 21


    You will then have to add a condition (https://www.jotform.com/help/268-how-to-insert-text-or-calculation-into-a-field-using-conditional-logic) to make the calculation as follow:

    1614514425 603b88f95428e  Screenshot 32


    We are doing Today - Birthday which we divide by 365 to have the number in years and not in days.

    We then use the floor() function to round it to the lowest number (so that 30.65 becomes 30).

    You can find the floor() function under the three little dots at the bottom right of the calculator.


    As this might be a little bit confusing, I have a test form for you that you can clone (https://www.jotform.com/help/42-how-to-clone-an-existing-form-from-a-url) to have a better representation of what I am trying to explain.


    Hope this helps.

    Do not hesitate to reach out if you need further assistance.