When entering dates into your Excel age calculation, these should be entered as either:
It is not recommended that dates be entered as text representations of dates, as these may be interpreted differently, depending on the date settings on your computer.
The simplest way to calculate age in Excel is to use the Excel Yearfrac Function, which returns the number of years between two dates.
I.e. The number of years between two dates, start_date and end_date is calculated as follows:
The following spreadsheet shows the Excel Yearfrac function, used to calculate the age, on 01/01/2017, of an individual who was born on 03/03/1960:
A | B | |
---|---|---|
1 | Birth Date: | 03/03/1960 |
2 | Current Date: | 01/01/2017 |
3 | Age: | =YEARFRAC( B1, B2 ) |
The function in cell B3 of the above spreadsheet returns the value 56.82777778.
I.e. on the date 01/01/2017, a person who was born on 03/03/1960, was 56 years old.
If you want to tidy up the above age calculation, so that it returns an integer, rather than a decimal value, this can easily be done using the Excel Int Function, which truncates a supplied number down to the closest integer.
In the spreadsheet below, the Int function is used to truncate the result of the Yearfrac function to an integer.
A | B | |
---|---|---|
1 | Birth Date: | 03/03/1960 |
2 | Current Date: | 01/01/2017 |
3 | Age: | =INT( YEARFRAC( B1, B2 ) ) |
The function in cell B3 of the above spreadsheet now returns the value 56.
If you want your age formula to calculate the age of an individual on the current date, and to update automatically each day, this can be done using the Excel Today function, which returns the current date.
Therefore, if you replace the value in cell B2 of the above spreadsheet, with the formula =TODAY(), this will be used in the age formula in cell B3.
Alternatively, you could use the Today function directly in the age formula, so that the Excel age calculation formula becomes: