- CNSTradingLtdAsked on March 16, 2017 at 03:32 PM
I would like to calculate a persons age on a particular date.
IE. How old, in an integer was someone on 31/08/2016 ?
Sure it's simple, but got a bit of brain fade at the moment.
- JotForm SupportMikeAnswered on March 16, 2017 at 05:52 PM
Your formula looks correct, the only thing I am not sure is the -1 operation from the calculated age.
In case you need to round down calculated age (e.g. 33.7 to 33) it is possible to use a floor() function in formula.
If you need any further assistance on this, please let us know. We will be happy to help.
- CNSTradingLtdAnswered on March 21, 2017 at 03:06 PM
- CNSTradingLtdAnswered on March 21, 2017 at 03:16 PM
Just to make clear what I mean.
Someone born on or after 31/08/1999 should give an age of 16
Someone born before 31/08/1999 (30/08/1999 and before should give an age of 17
If you test, this works fine for someone born in 1999 but is out by a couple of days
for other years.
- JotForm SupportMikeAnswered on March 21, 2017 at 05:10 PM
You may try the next formula for more precision result, where 17044 value represent the 31/08/2016 date.
The 31/08/1999 DOB should give an age of 17 if I am not missing anything.
Here is a test form:
- CNSTradingLtdAnswered on March 22, 2017 at 07:05 AM
This looks great.
One thing, the age returned on the 31/08/2016 should be 16 not 17.
Just so you know what this is for.
In UK Junior cricket, someone can play in an Under 16 league if they are 16 or under on 31/08/2016.
Any chance you could amend.
- CNSTradingLtdAnswered on March 22, 2017 at 07:11 AM
I mean for someone born on 31/08/1999
- CNSTradingLtdAnswered on March 22, 2017 at 07:20 AM
I think its to just change 17044 to 17043 ?
- JotForm SupportWelvinAnswered on March 22, 2017 at 12:47 PM
I'm not sure if that will work, but please try it and let us know any instance that the method won't give you a correct result.