# DOB (Year) calculation from Age entered in Years

Hi,

I have developed a survey form where I can calculate age from DOB which is a “date” field and can save the value into the server.

But my team has developed a new requirement. The area where we are going to conduct this survey is almost rural area. People can assuming and answer about their age but can’t define their exact date of birth.

So, we need a integer field where we can input the age and date of birth (year) will be automatically detected. Then we can select month and date assuming not accurately.

Again, I can do it in text field but can’t define in a calendar.
Pls help me in this regard.

Thanks

So you mean when you enter the age the form should generate the Year (based on the age)?

Hello @asif_rahman_joy,
Sorry, this is more a methodological reply.
In a similar context we used an enumeration rule with a normal date field:

• If month is not known, set it to June.
• If day is not known, set it to 15.

And we checked against age given.
Furthermore we added a variable to report on estimation.

We also supported the enumerators for date questions with a local historical events calendar, like year of independance, last heavy drought, new gouvernment, death or inauguration of famous local leader etc.

If you analyse age (or year) frequencies, you will probably see peaks around 10- and 5-step ages. Don’t trust to much that you get more accuracy than 5-step age groups.

You might also need to check filtering for question groups, like education or child topics, with additional variables, as a person reporting age 5 may be 6, 7 or 4 in reality.

1 Like

Yes… that’s right!!

ok… your points are noted with thanx

@asif_rahman_joy, you could do it as outlined in the image shared below:

#### Reference XLSForm:

Calculate Age.xlsx (8.6 KB)

1 Like

Hello @asif_rahman_joy, @Kal_Lam
Sorry, I am not sure that this is working well. Examples
Today() 2021-12-09
Age_ Birthday ____ YearBorn
2 ___ 2019-11-01 __ 2019
1 ___ 2019-12-24 __ 2019

I think there has already been previous solutions in the forum, how to calculate age.

But I need to use “date” instead of “note”.

Thing is like that. We ask about the age. He/she will answer age (year). We will enter age in the survey form as integer question type. As soon as we entered age in year, the following “date” question will select automatically the year. We will select only month and date. That will save a lot of time.

Let me know if this is possible.
Thanks for baring with me.

Hello @asif_rahman_joy,
You may have a look at the example above, please.
2 persons with same (completed) age can be born in TWO different years.