Calculate Age in Excel

Age Calculation in Excel Sheet

This happens most of the time that we need to know the time gap between two dates, and calculating this age or time gap between two dates can be complex if this is not done with the help of excel. This complexity of calculation can be changed to fun if we are using the excel functions. This is because, in excel, the age or the time gap between the two dates can be calculated in the various terms. This means that the age can be calculated in years, months, and also in terms of days.

Calculating the age without the use of excel can be so tiring as calculating the age is very complex sometimes, especially if the age has to be calculated from the two dates that do not represent a complete month.

Calculating age in excel very simple as this can be done with the help of simple formulas. In excel, we do not have a specific function that can calculate the age, but we need to use the other date functions of excel to get the age in the desired format. We can get the age in terms of years, months, and days also.

How to Calculate Age in Excel Sheet?

Below are the examples to Calculate Age in Excel Sheet.

You can download this Calculate Age Excel Template here – Calculate Age Excel Template

Example #1- Calculating the Age in Excel in Terms of a Year

To calculate the age in terms of years, we will use the function of “DATEDIF.”

Below are the steps of calculating age in excel –

  1. To calculate the age in terms of years, we will use the function of u0022DATEDIF.u0022

    calculate age in excel Method 1

  2. Enter the formula of u0022dated ifu0022 as below.

    =DATEDIF(Past Date,Current Date, u0022Yu0022)

    calculate age in excel Method 1-1

    Past Date: This means the cell that has the beginning Date.
    Current date: This means the cell that has a date that falls after the beginning date.
    u0022Yu0022: This means that we need the Age in terms of years only.

    Age Calculator Method 1-2

  3. After the function has been inserted, then we will get the result that shows the Age as completed years only.

    Age Calculator Method 1-3

    Calculate age, including a fraction of years.

    Age Calculator actual years

Example #2 – Calculating the Age in Excel Terms of Months

If we need the Age in terms of months, then we just need to do just a little change in the formula of dated if that we have used in case of calculating the Years.

=datedIf(Past date,Current date,”M”)

Age Calculator Method 2

Now we have used “M” as we need the Age in terms of months only.

Age Calculator Method 2-1

Drag the Formula to get the rest of the results.

Age Calculator Method 2-2
  • Calculating age in terms of Months(Including partial months)
Age Calculator actual months

Example #3 – Calculating the Age in Excel in terms of days

If we need the Age in terms of Days, then we just need to simply use the excel formula below

=datedIf(Past date, Current date,” D”)

Age Calculator Method 3
Age Calculator Method 3-1

Drag the Formula to get the rest of the results.

Age Calculator Method 3-2

Example #4- Calculating the Age in Excel in Year, Months, and Days

If we need to know the age in terms of Age, months, and years, then we need to use a concatenate excel formula along with the DATEDIF formula.

Now, if we need to know the Age in “Y/M/D,” then we mean that we want the excel to tell us the completed years, months that are above the completed years, and at last, the days that do not make a complete month.

=CONCATENATE(DATEDIF(A2,B2,”Y”),” years “,DATEDIF(A2,B2,”YM”),” Months and “,DATEDIF(A2,B2,”MD”),”Days”)

Age Calculator Method 4

In the above formula, we have used

  • “Y”: This means that we need years.
  • “YM”: This means that we need months that are above the completed years.
  • “MD”: This means that we need the days that above the completed months.
Age Calculator Method 4-1

Drag the Formula to get the rest of the results.

Age Calculator Method 4-2

Calculating the Age with the help of Excel VBA

If we want to use VBA for calculating the Age, then we have to write a code in VBA.

Step 1: Open VBA editorVBA EditorThe Visual Basic for Applications Editor is a scripting interface. These scripts are primarily responsible for the creation and execution of macros in Microsoft software.read more by clicking the keyboard key Alt+F11

Step 2: Define the code.

Age Calculator Method 5

Here in the code, we have defined “age” as a variant and given its source as the Cell A1 of the sheet. This A1 cell has the formula that we have used in the above examples.

Step 3: Enter the date in the “MM/DD/YY” format.

calculate age in excel Method 5-1

Step 4: Click on “Show AGE as of date” key.

calculate age in excel Method 5-2

Step 5: The result will be shown in Msg. Box as below.

calculate age in excel Method 5-3
  • In the above examples, we have seen the various examples of how age can be calculated between two dates. By this time, we must be able to understand that age can only be calculated if we have two dates, one of which falls before the second one. In excel terms, the dates are not dates but some code that is reflecting the date on the screen. This means that 1/1/2019 might be 1st Jan 2019 to us, but to excel, this not a date; this is 43466 in its terms.
  • Excel uses its own coding for dates, and this coding is then formatted for us so that we can see that number as data. Since there is nothing that is called date to excel hence excel is able to subtract two dates.
  • In the above examples, we have used the “DatedIf” formula to calculate the Age between two dates. This function does not appears in the autocomplete function when we start typing the function. This is because this function is hidden to excel and does not come as a suggestion by excel. So this is important that we should know the complete syntax of this function.

Things to Remember

  • A datedif function will not appear in the autocomplete option if we have started typing this function. So this is important that we know the complete syntax of this function.
  • The two dates should be in the same format for calculating the age.
  • This should be remembered that while using a datedif function, we need to first enter the date that falls prior to the date that we will be entering in the second option of syntax.
  • If, in case we are getting a date instead of age, then we must change the formatting of that cell to number from date.

Recommended Articles

This has been a guide to Calculate Age in Excel. Here we discuss how to calculate age in excel sheet using DATEDIF Formula, CONCATENATE Formula, and also using excel VBA code along with practical examples and a downloadable template. You may learn more about excel from the following articles –

  • 35+ Courses
  • 120+ Hours
  • Full Lifetime Access
  • Certificate of Completion
LEARN MORE >>

Reader Interactions

Leave a Reply

Your email address will not be published. Required fields are marked *