You need to sign in to do that
Don't have an account?
lkp
Leap year giving me an error in Age formula field
I have this formula to caclulate the age of an employee:
IF(ISBLANK(Birthdate__c),
0,
IF(TODAY()-DATE(YEAR(TODAY()),MONTH(Birthdate__c),DAY(Birthdate__c))<0,
YEAR(TODAY())-YEAR(Birthdate__c)-1,
YEAR(TODAY())-YEAR(Birthdate__c)
)
)
There is one person with their birthdate on on a Leap year and is giving me #ERROR in the Age field. What can I do to add Leap year information?
Thanks.
IF(ISBLANK(Birthdate__c),
0,
IF(TODAY()-DATE(YEAR(TODAY()),MONTH(Birthdate__c),DAY(Birthdate__c))<0,
YEAR(TODAY())-YEAR(Birthdate__c)-1,
YEAR(TODAY())-YEAR(Birthdate__c)
)
)
There is one person with their birthdate on on a Leap year and is giving me #ERROR in the Age field. What can I do to add Leap year information?
Thanks.
I hope, this will help you. :)
All Answers
If((Date.year() / 4 == 0),(
calcutate the DOB;
,
IF(ISBLANK(Birthdate__c),
0,
IF(TODAY()-DATE(YEAR(TODAY()),MONTH(Birthdate__c),DAY(Birthdate__c))<0,
YEAR(TODAY())-YEAR(Birthdate__c)-1,
YEAR(TODAY())-YEAR(Birthdate__c)
)
)
)
You can refer to the Knowledge Article: https://help.salesforce.com/apex/HTViewSolution?id=000004939&language=en_US
Thanks,
Pratik
I hope, this will help you. :)
Yes that worked! Thank you.
One more question:
We also have a birth month formula flield and I am getting the same error for the Leap year date (#ERROR!) The birthdate is 2/29.
DATE( YEAR( DATEVALUE( NOW() ) ) , MONTH( Birthdate__c ) , DAY( Birthdate__c ))
How can I fix this for the birth month?
Thanks!