CALCULATE BIRTH DATE

  • Profile Image
    Codyiwanow52
    Asked on February 27, 2021 at 09: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

    Screenshot
  • Profile Image
    Gaetan_B
    Answered on February 28, 2021 at 07: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_


    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_


    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_


    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.