Use DATEDIF to Calculate Date Differences Across Centuries in Excel
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.

- 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.
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.
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.
Type your start date (e.g., 12/15/1999) into cell A2 and your end date (e.g., 3/20/2024) into cell B2.
Select a blank cell where you want the result to appear and type the formula: =DATEDIF(A2,B2,"y")
Press Enter. The cell will display the total number of fully completed years between the two dates.

Display the Exact Difference in Years, Months, and Days
Combine multiple DATEDIF functions to create a detailed text string showing the exact duration across centuries.
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. 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. Apply the Formula: Select the output cell and type =DATEDIF(A2, B2, "y") to calculate the years.
- 3. Get Instant Results: Press Enter to instantly view the precise time difference without compatibility issues.

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.




