Function Problems

How to Calculate Elapsed Years and Months as YY.MM in Excel

Camila MilosovichCamila Milosovich Nov 2, 2026 868 views

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).

How to Calculate Elapsed Years and Months as YY.MM in Excel
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.
Before you start

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.

Solution 1Recommended

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.

1
Select the target cell

Click on the empty cell where you want the elapsed time to be displayed.

2
Input the formula

Type the formula: =DATEDIF(A2,TODAY(),"y")&"."&DATEDIF(A2,TODAY(),"ym"). Replace 'A2' with the cell reference that contains your start date.

3
Apply the result

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 DATEDIF Function (Recommended)
Hidden Function: DATEDIF is a hidden legacy function in Excel. It will not appear in the formula autocomplete drop-down, but it will work perfectly when typed manually.
Solve Date Calculations Easily

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. 1. Open your workbook: Launch WPS Spreadsheet and open the document containing your date records.
  2. 2. Enter the DATEDIF formula: Select an empty cell and type =DATEDIF(A2,TODAY(),"y")&"."&DATEDIF(A2,TODAY(),"ym").
  3. 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.
Fully compatible with Microsoft Excel formulas and the .xlsx format.Supports hidden legacy functions like DATEDIF out-of-the-box.Lightweight, fast processing for large datasets and complex calculations.Completely free to use with a familiar user interface.
microsoft office alternative - wps office

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(...)).