Show age after user input date of birth

Hi,

I have users input their Date of Birth through a form using a Date Picker. The date gets saved in this format: MM/DD/YYYY. For example, 11/13/2019.

I want to calculate the age of the user. What formula might work for this?

I found this forum that helps answer this question but it doesn’t work correctly.
Link: Populating Age in Database

1st problem: It shows the age as a negative number. For example, -4.
2nd problem: I also wasn’t sure what the date format should be in the formula. I set them both to the “Year Number”. It works but it was still negative.

image

Any help is appreciated! Thank you!

Hi @NavD,

For remove negativeness you can use the ABS function!

Here’s how I did it! : Calculate Age.mp4 - Google Drive

Math Functions Adalo Docs : How to Create a Custom Math Formula - Adalo Resources

Thank you

Hi dilon_perera, this worked perfectly! Thank you for your help.

The only thing I would add is that equation can be more accurate by adding .24 after 365. This helps when the date of birth is the same as the current date.

So, INT(ABS((Current Time - Birthday) / 365.24)).

I also liked your Quizzy app. I’m going to add a similar feature.

Thanks!

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.