+ Start a Discussion
Aashish JainAashish Jain 

age formula

Formula to calculate the Age in Years,Months, Weeks and Days


IF(
NOT( ISNULL (Date_of_Birth__c)), /* Condition */

TEXT(FLOOR((TODAY()-Date_of_Birth__c)/365.2425)) & " Years " &
TEXT(FLOOR(MOD((TODAY()-Date_of_Birth__c),365.2425)/30)) & " Months " & 
Text(Floor(MOD(Floor(MOD((TODAY()-Date_of_Birth__c),365.2425)),30)/7)) & " Weeks "  & 
 TEXT( FLOOR( MOD( FLOOR( MOD( FLOOR( MOD(TODAY()-Date_of_Birth__c,365.2425) ) ,30) ) ,7) ) ) 
& " Days" ,  
/* Value IF True */
"Check your DOB " /* Value IF False */
)
William TranWilliam Tran
What are you trying to do?  Create a validation rule?  If yes what is the rule?  Thx
pconpcon
Does this formula not work? How is it failing?  You may be better off splitting this into several formulas (one for years, months, weeks, days) and then using those to generate the following based on the previous.  For example, use years to generate months, months to generate weeks etc.