function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Guyver118Guyver118 

Contacts age at next birth date that takes care of leap years?

Hi i have a field called date of birth and i am trying to show the age of the contact at his next birthday, but i can't seem to incorporate leap years :(.
Best Answer chosen by Admin (Salesforce Developers) 
JakesterJakester

Try 

 

 

FLOOR((TODAY()-Birthdate)/365.2425)+1

 

 

 

Remove the +1 to show contact's current age.

 

All Answers

JakesterJakester

Try 

 

 

FLOOR((TODAY()-Birthdate)/365.2425)+1

 

 

 

Remove the +1 to show contact's current age.

 

This was selected as the best answer
Guyver118Guyver118
What about leap years for example if the birthday was on 29/02/1956 i get an error in the formula field.
JakesterJakester

Then I guess you didn't enter it correctly, because it's working fine for me.

Here's a screenshot of the results, using the birthday you gave me:

http://yfrog.com/5jagep

 

And here's a screenshot of how I set it up - I added an If() check in case the birthday was not entered:

http://yfrog.com/5kage2p