Calculate Age from Date of Birth in Salesforce

by Sudipta Deb | Oct 31, 2014 | formula, Salesforce, tutorial | 4 comments

Below formula can be used to calculate age from date of birth in Salesforce –

IF(
NOT(ISNULL(BirthDate)), /* Condition to check to make sure BirthDate is not null */
TEXT(FLOOR((TODAY()-BirthDate)/365.2425)) & " year(s) " &
TEXT(FLOOR(MOD((TODAY()-BirthDate),365.2425)/30)) & " month(s)", /* Value IF True */
"" /* Value IF False */
)

Written by

Related Posts

Salesforce Cancels the “Permissions in Profiles” Retirement: What It Means for Admins and Architects

Salesforce Cancels the “Permissions in Profiles” Retirement: What It Means for Admins and Architects

For the last few years, Salesforce administrators, architects, and security teams have been preparing for a major platform change: the retirement of permissions managed directly through Profiles. Salesforce had previously announced plans to move organizations toward a Permission Set–led security model, with enforcement expected to begin around the Spring ’26 timeframe.

read more...

4 Comments

  1. Sudipta Deb

    Hi Manohar –

    Feeling good that you liked it. Here is the formula which you can use –

    Return type: text
    TEXT(FLOOR((TODAY() – Date_Of_Birth__c)/365.25)))& " years" & TEXT(MOD((TODAY() – Date_Of_Birth__c),365.25)) & " days"

    Reply
  2. Unknown

    This comment has been removed by the author.

    Reply
  3. Unknown

    Hi Sudipta,

    Thanks for the update.
    I tried your formula like below, But date result showing wrong. Please once check and let me know.

    Note: Dates showing wrong value and showing xxx.yy days format. I don't need decimal places, please update this.

    IF(
    NOT(ISNULL(Birth_Date__c)), /* Condition to check to make sure BirthDate is not null */
    TEXT(FLOOR((TODAY()-Birth_Date__c)/365.2425)) & " year(s) " &
    TEXT(FLOOR(MOD((TODAY()-Birth_Date__c),365.2425)/30)) & " month(s)" &
    TEXT(MOD((TODAY() – Birth_Date__c),365.25)) & " days", /* Value IF True */
    "" /* Value IF False */
    )

    Reply
  4. Unknown

    Calculate age from Custom Birthdate__c through process Builder in salesforce

    Please Suggest me

    Reply

Leave a Reply