How to Calculate Elapsed Years and Months as YY.MM in Excel
Question details
The user needs a formula to calculate the elapsed time between a specific past date and the current date, displaying the exact duration in a specific years and months format separated by a decimal point (YY.MM).

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Calculating exact age, tenure, or project duration between dates for reporting purposes, where standard division by 365.25 is not accurate enough.
- Observed behavior
- Standard date subtraction divided by 365.25 produces inaccurate decimal fractions, failing to properly separate distinct calendar years and remaining months.
Ensure that the cells containing your starting dates are correctly formatted as 'Date' values in Excel; otherwise, the calculation formulas will result in a #VALUE! error.
Use the DATEDIF Function (Recommended)
The DATEDIF function is the most accurate and reliable method for extracting exact elapsed years and remaining months between two distinct dates.
The DATEDIF function calculates the difference between two dates. By utilizing the 'y' parameter, we can extract the complete years, and by using the 'ym' parameter, we extract the remaining months after the full years are subtracted.
Click on the empty cell where you want the elapsed time to be displayed.
Type the formula: =DATEDIF(A2,TODAY(),"y")&"."&DATEDIF(A2,TODAY(),"ym"). Replace 'A2' with the cell reference that contains your start date.
Press the Enter key. The cell will now display the exact elapsed time formatted as YY.MM (e.g., 7.11 for 7 years and 11 months).

Use the YEARFRAC Function Alternative
If you prefer not to use DATEDIF, you can mathematically extract the years and months using the YEARFRAC function combined with INT and MOD.
Calculate Date Differences Flawlessly in WPS Spreadsheet
WPS Office Spreadsheet provides full support for advanced date and time functions, including DATEDIF and YEARFRAC, allowing you to build complex chronological reports with ease.
- 1. Open your workbook: Launch WPS Spreadsheet and open the document containing your date records.
- 2. Enter the DATEDIF formula: Select an empty cell and type =DATEDIF(A2,TODAY(),"y")&"."&DATEDIF(A2,TODAY(),"ym").
- 3. Apply to multiple rows: Press Enter, then click and drag the fill handle at the bottom-right of the cell to apply the calculation to your entire column.

Frequently Asked Questions
Why does my DATEDIF formula return a #NUM! error?
The DATEDIF function returns a #NUM! error if the start date is greater than the end date. Ensure the older date (the past date) is set as the first argument in the formula.
How do I add a leading zero to single-digit months, like 7.04 instead of 7.4?
You can format the month portion using the TEXT function. Update the second part of your formula to look like this: =DATEDIF(A2,TODAY(),"y")&"."&TEXT(DATEDIF(A2,TODAY(),"ym"),"00"). This ensures single-digit months display with a leading zero.
Can I format the YY.MM result as a real number for further calculation?
Yes. The current formula uses an ampersand (&) to join the values, resulting in a text string. To convert it into a workable number, wrap the entire formula inside the VALUE function: =VALUE(DATEDIF(...)&"."&DATEDIF(...)).




