What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Age Calculation

    Asked by GICS on June 11, 2015 at 12:50 AM
    Further to this, I would like to have a calculation that populates the age field in years where the age is the age as at the start date of the competition. Is this possible?
  • Profile Image
    JotForm Support

    Answered by Chriistian on June 11, 2015 at 01:23 AM

    Hi GICS,

    Thanks for contacting us.

     

    Yes this is possible, you can check this form that I created http://form.jotformpro.com/form/51610432657956You can clone this form so you can check out the setup. This is done using Date/Time Tool under Quick Tools and a Form Calculation Widget. You can check the calculation formula when you open the calculation wizard by clicking the wand icon.

     

    Do let us know if you need further assistance.

     

    Regards.

  • Profile Image

    Answered by GICS on June 11, 2015 at 01:32 AM

    Brilliant! Many thanks.

    Peter

  • Profile Image
    JotForm Support

    Answered by Chriistian on June 11, 2015 at 03:16 AM

    Hi GICS, 

    You are welcome. Glad to hear that your concern was solved.

     

    If you need further assistance, please feel free to contact us again.

     

    Regards.

  • Profile Image

    Answered by GICS on June 11, 2015 at 08:37 AM

    Hi Chriistian,

     

    On a closer look, the age does not calculate exactly especially when a birthday might be just either side of the competition start date.

    I think it has something to do with the number of days in the year and that we want the age expressed in years, so we probably need a way to remove the part of the answer to the right of the decimal point.

    Interesting little dilemma.

    Peter

  • Profile Image
    JotForm Support

    Answered by Boris on June 11, 2015 at 10:20 AM

    Peter, please try calculating the age as:

    age / 365.25

    I have made a demo form with a changed calculation, it should be rather accurate:

    http://form.jotformpro.com/form/51613647325959

    Please let us know if this works better for your needs, or please let us know example dates it calculates wrong, so that we can take a look if we can somehow tweak it to better suite your specific case. Thank you.

  • Profile Image

    Answered by GICS on June 11, 2015 at 08:37 PM

    No, that didn't work on it's own.

    I was correct in my assumption that although I present the answer to 0(zero) decimal places, the decimal part of the answer is still there..

    The full answer is..

    Calculate days by subtracting the birth date from the start of comps date

    Then Age = FLOOR(days\365.25)  - the 0.25 accounts for leap years

    FLOOR strips off the decimal part of the answer.

    This seems to work now.

    Whew.

     

    Peter

     

  • Profile Image
    JotForm Support

    Answered by Chriistian on June 11, 2015 at 11:32 PM

    Hi GICS, 

    Glad to hear that you have solved your problem.

     

    Do let us know if you need further assistance.

     

    Regards.