0

I would like to know what formula to use in age calculation to get someone’s age at January the 1st 2018, after input of his date of birthday.

0

I'm a developer with Cognito Forms.

We do have an age calculation in our help content that can be set up to display a users age based on their entered birthday.

  1. Add a Date field to your form labelled Birth Date.

  2. Add a Calculation field labelled Age, set to the Text type.

  3. Insert the following expression as your calculation:

=DateTime.Today.Year - BirthDate.Year + (if DateTime.Today.Month < BirthDate.Month or (DateTime.Today.Month = BirthDate.Month and DateTime.Today.Day < BirthDate.Day) then -1 else 0)

  • That would calculate the age acording to today date, but i really need it to calculate the age on january the 1st. – Filipe Campaniço Dec 23 '17 at 0:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.