How to Calculate Age in Excel
Calculating the date difference between two dates is a common task in Excel. This tutorial will show you how to calculate the age of a person based on their date of birth using a variety of methods.
Datedif function
To calculate age in Excel, you can use the following formula:
=DATEDIF(birthdate, today,”unit”)
Where:
- birthdate is the cell containing the date of birth
- today is the current date, which you can get using the TODAY() function
- unit is the unit you want to use to calculate the age, which can be:
- “y” for years
- “m” for months
- “d” for days
- “ym” for the number of complete years and months
- “md” for the number of complete months and days
Age calculator
To calculate the age in Excel follow these steps:
1. In the table, put the necessary data, such as name and date of birth.
2. Click on the cell where you want to see a person’s age in years (for example, it is C2). Then in the box, type the following formula:
=DATEDIF(B2,TODAY(),”Y”)
B2 is the address of a cell containing a date of birth. Press the Enter key. Age will be calculated as indicated by our cells.
In the same way, you can show in Excel your age in months.
To do this, repeat steps 1 and 2, except that in the formula, instead of Y put M. The formula is the following entry:
=DATEDIF(B2,TODAY(),”M”)
To calculate in Excel the number of days that have passed since a certain date, such as the date of birth, also repeat steps 1 and 2. This time the formula looks like this:
=DATEDIF(B2,TODAY(),”D”)
Of course, instead of always serving the B2 cell address of the date on which Excel is to start counting. An example formula is:
=DATEDIF(B2,”2013-5-1″,”M”)
Leave a Reply