Calculate Age in Excel (Table of Contents)
- Introduction to Calculate Age in Excel
- How to Calculate Age in Excel?
- How to Use the DATEDIF function in Excel?
Introduction to Calculate Age in Excel
To calculate Age in Excel, we must have the Date of Birth of that person. We can calculate the age in excel with the help of the TODAY function. For this, select the cell which has the Date Of Birth, and subtract this Date of Birth from today’s date, which we can get using the TODAY function. This would give us the number of days from the selected Date of birth to till date. And then divide that by 365, which is the actual number of days in a Year. This would give the Age of that person to date.
How to Calculate Age in Excel?
Let’s find the steps to calculate age in excel with some examples.
Example #1 – Calculate Age in Excel
In excel, we can calculate the age of a person if we know the person’s date of birth and the current date. Consider the below example where we have the current date and date of birth.
Here we can use the simple logical formula to find out the Age by using below formula.
= (B1-B2)/365.25 gives you the result as shown below.
Here we have just subtracted the current date- date of birth/365.25 why we have used 365.25 because, in order to get an account for a leap year which appears every 4 years, it will not give us the appropriate result because we got an age output in decimal places, so in order to round off the value, we can use the “ROUNDDOWN function which is normally used to round down the decimal places.
ROUNDDOWN function Formula in Excel
=ROUNDDOWN (Number, num_digit) where the number is used to round down the number, and num_digit is used to round down the number to many decimal places.
=ROUNDDOWN((B1-B2)/362.25,0) will give the roundup values shown in the below result.
Result:
In the below result, we can see the difference. After applying the round-down function, we got the exact output of 37; before that, we got the same age output as 37.44
Now we will see how to calculate Age in excel by using the built-in function.
The DATEDIF function is the built-in function in excel where it returns the difference between the two date values in years, months, or days.
DATEDIF function Formula in Excel:
Arguments & Parameters to Calculate Age in Excel
- Start date: – Represents the start date where we will enter a text string.
- End date: – Represents the end date where we will enter a text string.
- Unit: – This will find the time unit based on the specified text string such as Years, Months, and dates. i.e.( Y,M,D,MD,YM,YD) in double-quotes.
- Y:-This Year’s unit will find the number of completed years.
- M:-This Month’s Unit will find the number of completed months.
- D: – This Day Unit will find the number of Completed days.
- MD: – This Month Day Unit will find the difference in days, but it will ignore months and years.
- YM:-This Year Month Unit will find the difference in months, but it will ignore days and years.
- YD: – This Year Date Unit will find the difference in Days, but it will ignore the years.
Example #2 – Calculating Using the DATEDIF Function
In Microsoft, excel DATEDIF is a compatibility function where we need to use the formula correctly. Like other functions, the DATEDIF function will not help if we apply the wrong data, and also, it will not show the arguments while using the function, which is shown below.
In this example, we will see how to calculate age using the DATEDIF function. In order to calculate the age of any specific person, we need two things, the date of birth and the current date, so that we can apply the DATEDIF function by following the below steps.
Consider the below example where it has an employee name, designation, date of birth, and current date, and we have also created three new columns Year, Month, and Day to get the output.
First, we will see how to calculate the age excel of the employee using the DATEDIF function.
- First, click on cell E2, which is nothing but the Year column.
- Now apply the DATEDIF function in excel as shown below=DATEDIF(C2, D2, “Y”), C2 is nothing but the date of birth of the employee, D2 is the current date of the year, “Y” which will return the total completed years.
- Let’s see how we have applied the formula in excel, which is shown below. Here in the above screenshot, we can see the DATEDIF function calculated with the “Age” of an employee as 40.
- Now drag down the formulas to all the cells so that we will come to know the age of all employees, which is shown as a result in the below screenshot.
Example #3 – Calculating the Month of the Employee
Now we are going to use the same DATEDIF function to find out the month of the employee, i.e. on which month exactly he/she was born. To find out the month of an employee, follow the below steps follows.
- First, click on the F2 cell, which is nothing but the Month Column.
- Now apply the DATEDIF function in excel as shown below=DATEDIF(C2, D2, “YM”), C2 is nothing but the date of birth of the employee, D2 is the current date of the year, “YM” which will return the difference in months.
- Once the formula has been applied, it will be displayed as follows. Here in the above screenshot, we can see the DATEDIF function calculated with the difference of “month” of the first employee as 7.
- Now drag down the formulas to all the cells so that we will come to know the month of all employees, which is shown as a result in the below screenshot.
Example #4 – Calculating Employee day
Now we are going to calculate on which day an employee has been born exactly by using the same DATEDIF function by following the below steps.
- First, click on the G2 cell, which is nothing but the Day Column.
- Now apply the DATEDIF function in excel as shown below=DATEDIF(C2, D2,” MD”), C2 is nothing but the date of birth of the employee, D2 is the current date of the year, “MD” which will return the difference in days.
- Once the formula has been applied, it will be displayed as follows. Here in the above screenshot, we can see the DATEDIF function calculated with the difference of “days” of the first employee as twenty-three “23”.
- Now drag down the formulas to all the cells so that we will come to know the days of all employees, which is shown as a result in the below screenshot.
Henceforth we have calculated the age of all the employees by calculating their Age, Month, and Day.
Things to Remember About Calculate Age in Excel
- The DATEDIF function will not help like other functions because while using the DATEDIF function, we should use the formula in the correct manner.
- We cannot copy the DATEDIF function to another cell, or else Excel will throw a NUM error.
Recommended Articles
This has been a guide to Calculate Age in Excel. Here we discuss Calculate Age in Excel and how to use Calculate Age in Excel along with practical examples and a downloadable excel template. You can also go through our other suggested articles –
23 Online Courses | 9 Hands-on Projects | 110+ Hours | Verifiable Certificate of Completion
4.9
View Course
Related Courses