How can I calculate age from the birthday entered?

  • Profile Image
    JulietKing
    Asked on June 24, 2020 at 01:07 AM

    Hi there, 

    Just wondering if there is a way for a participants 'age' to be automatically populated if they have input their birthdate? I've attempted to do this through the calculation fields but come unstuck. 

    Thanks

    Juliet

  • Profile Image
    truman
    Answered on June 24, 2020 at 04:10 AM

    Hi,

    You can calculate the participants' age with the steps below:

    1- First add a date element. After that, rename as 'Current Date' and change the settings. In the settings, choose 'Current Date' option and hide it. This will prevent the current date area seen by participants.

    1592985892screencast 2020-06-24 10-30-24

    2- After these steps, you can add an if condition to subtract the 'Date of Birth' area from 'Current Date'. This option going to subtract by dates so it needed to be divided by 365.25. 
    You also need to get the value rounded down, that is why you will use the "floor()" math function. You can choose the result to be seen at 'age' element.

    1592985950screencast 2020-06-24 10-56-03

    If you require more information please let us know.