Calculate current year with age

Hi All,

I am working on a from where if DOB is not known
i need to enter person age manually ie.. Age: 30
then based on age entered manually i need to auto calculate year of birth of that person.
ie.., year : 1989 should get displayed automatically

thanks in advance

Try the following:
birth_calculation.xlsx (8.8 KB)

+-----------+---------------------+--------------------------------------------------+------------------------------------------+----------+
|   type    |        name         |                      label                       |               calculation                | required |
+-----------+---------------------+--------------------------------------------------+------------------------------------------+----------+
| calculate | current_time        | current_time                                     | once(now())                              |          |
| calculate | current_year        | current_year                                     | format-date(${current_time}, '%Y')       |          |
| integer   | age                 | Age (years)?                                     |                                          | yes      |
| calculate | calculated_birth    | calculated_birth                                 | number(${current_year}) - number(${age}) |          |
| note      | display_calculation | The calculated birth year is ${calculated_birth} |                                          |          |
+-----------+---------------------+--------------------------------------------------+------------------------------------------+----------+

EDIT: see this post for a more accurate solution

2 Likes

Thank you.
It was helpful.