Creating age calculator form

  • CNSTradingLtd
    Asked on March 16, 2017 at 3: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.

    Thanks

    Robert

     

  • Mike
    Replied on March 16, 2017 at 5:52 PM

    Your formula looks correct, the only thing I am not sure is the -1 operation from the calculated age.

    Creating age calculator form Image 1 Screenshot 30

    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.

    Creating age calculator form Image 2 Screenshot 41

    If you need any further assistance on this, please let us know. We will be happy to help.

  • CNSTradingLtd
    Replied on March 21, 2017 at 3:06 PM

    Hi

    https://forme is on .jotformeu.com/70746410531348

     

    As I said, I need to know how old someone was on 31/08/2016 form their DOB.

    It works fine for someone born in 1999 and some other years but not for all years.

    Could be a leap year problem?

    Any ideas?

  • CNSTradingLtd
    Replied on March 21, 2017 at 3: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.

     

  • Mike
    Replied on March 21, 2017 at 5:10 PM

    You may try the next formula for more precision result, where 17044 value represent the 31/08/2016 date.

    Creating age calculator form Image 1 Screenshot 30

    The 31/08/1999 DOB should give an age of 17 if I am not missing anything.

    Creating age calculator form Image 2 Screenshot 41

    Here is a test form:

    https://form.jotformpro.com/70796253970971

    Thank you.

  • CNSTradingLtd
    Replied on March 22, 2017 at 7:05 AM

    Hi

     

    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.

    Many thanks.

     

  • CNSTradingLtd
    Replied on March 22, 2017 at 7:11 AM

    I mean for someone born on 31/08/1999

  • CNSTradingLtd
    Replied on March 22, 2017 at 7:20 AM

    I think its to just change 17044 to 17043 ?

  • Welvin Support Team Lead
    Replied 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.