Calculate age

  • Profile Image
    ReLivePT
    Asked on June 25, 2020 at 02:02 AM

    Hello,

    I am unable to calculate age using the suggested methods posted in the forums. Form link is below. Please advise. Thanks.

  • Profile Image
    Vanessa_T
    Answered on June 25, 2020 at 03:05 AM

    I just tested your form and it works correctly.

    1593068743A.gif

    Can you please give examples where it is not correctly calculating?

  • Profile Image
    Justin 
    Answered on June 25, 2020 at 08:20 AM

    Hi, it seems to be calculating now. Do you know why the age calc shows "50" by default when DOB is blank? 1593087536Screenshot_20200625-071432_Chr

  • Profile Image
    IvayloK
    Answered on June 25, 2020 at 08:45 AM

    It is because the hidden "Days Difference" field has a value even when "Date of Birth" is emtpy. This happens because the hidden "Today" field always has a value.

    So, the "Today" field reflects the "Day Difference" field, which then reflects the "Date of Birth".

    In order to avoid this, you can try to merge the Form Calculation widgets.

    Let us know if you need any further assistance.

  • Profile Image
    ReLivePT
    Answered on June 25, 2020 at 11:01 AM

    Can you explain how to merge the calc widgets? I removed the one calc for days difference and just included the floor((Today-Date of Birth)/365.25) in one calc. Thanks.

  • Profile Image
    Sam_G
    Answered on June 25, 2020 at 12:24 PM

    Hi ReLivePT,

    Let me work on this and will update you via this ticket.

  • Profile Image
    Sam_G
    Answered on June 25, 2020 at 01:58 PM

    Hi ReLivePT,

    Thank you for your patience.

    You may add a condition almost identical to the formula that you have.

    15931075496.25%20age%202.png

    Your form should look like this.

    15931077356.25%20age.gif

    Cloned form: https://form.jotform.com/201764601622953

    I hope this helps.

    Let us know if you need further assistance.