Function Problems

Use DATEDIF to Calculate Date Differences Across Centuries in Excel

Elise WilliamsElise Williams Nov 10, 2026 868 views

Question details

The user needs to calculate the exact duration (in years, months, and days) between two dates that fall in different centuries using a spreadsheet function.

Use DATEDIF to Calculate Date Differences Across Centuries
Product
Spreadsheet
Device & OS
not provided
Scenario
Calculating age, tenure, or project duration between a starting date in the 1900s and an ending date in the 2000s.
Observed behavior
The user wants to construct a formula that outputs the total completed years, months, and remaining days correctly, ensuring cross-century dates are properly recognized.
Before you start

Ensure both your start and end dates are formatted as valid dates rather than text, and verify that the start date is chronologically earlier than the end date to prevent formula errors.

Solution 1Recommended

Calculate Total Completed Years Between Two Dates

Use the basic DATEDIF formula with the "y" unit to extract just the completed years between a cross-century start and end date.

The DATEDIF function is a hidden but powerful tool for calculating time spans. It seamlessly handles valid dates spanning from 1900 up to 9999, making cross-century calculations straightforward.

1
Enter your dates

Type your start date (e.g., 12/15/1999) into cell A2 and your end date (e.g., 3/20/2024) into cell B2.

2
Input the DATEDIF formula

Select a blank cell where you want the result to appear and type the formula: =DATEDIF(A2,B2,"y")

3
View the result

Press Enter. The cell will display the total number of fully completed years between the two dates.

Calculate Total Completed Years Between Two Dates
Date Limitations: Standard spreadsheet programs only recognize dates starting from January 1, 1900. Dates prior to 1900 are treated as text and will not work with the DATEDIF function.
Seamless Spreadsheet Calculations

Calculate Complex Dates Easily with WPS Spreadsheet

WPS Spreadsheet fully supports the DATEDIF function, making it incredibly simple to calculate age, project durations, and cross-century date differences. With a highly intuitive interface and robust formula support, it is the perfect tool for all your data analysis needs.

  1. 1. Open WPS Spreadsheet: Launch WPS Office, open a new Spreadsheet, and input your start date in cell A2 and end date in cell B2.
  2. 2. Apply the Formula: Select the output cell and type =DATEDIF(A2, B2, "y") to calculate the years.
  3. 3. Get Instant Results: Press Enter to instantly view the precise time difference without compatibility issues.
Fully compatible with Microsoft Excel formulas, including DATEDIF.Automatically recognizes cross-century date formats seamlessly.Free to download with a lightweight, user-friendly interface.
QA img-9

Frequently Asked Questions

Why does my DATEDIF formula return a #NUM! error?

This error typically occurs if the start date is chronologically later than the end date. Ensure the older date (e.g., from the 1900s) is placed as the first argument in the formula.

Can DATEDIF calculate dates before the year 1900?

No, standard spreadsheet programs only recognize dates starting from January 1, 1900. Dates before this are treated as standard text and will cause the DATEDIF function to fail.

What do the "ym" and "md" units mean in the DATEDIF function?

The "ym" unit calculates the months between two dates while ignoring the years and days. The "md" unit calculates the remaining days between two dates while ignoring the months and years. These units are essential for building a combined 'years, months, days' string.