Fix Excel DATEDIF Returning a Large Number Instead of Years
Question details
The user needs to calculate the number of completed years between two dates instead of receiving a large numeric result.

- Product
- Microsoft Excel for Mac
- Device & OS
- macOS
- Scenario
- The user is comparing a start date and an end date to calculate an age, service period, or other elapsed time in years.
- Observed behavior
- Excel returns a large value such as 36550, which usually represents the number of days between date serial values rather than completed years.
Check that both referenced cells contain real Excel dates, not text that only looks like a date. Identify the start-date cell and end-date cell before entering the DATEDIF formula.
Use DATEDIF with the completed-years unit
Use this method when you need the number of whole years between a start date and an end date.
A large number commonly appears when dates are subtracted directly, because Excel stores dates as serial numbers and returns the elapsed number of days. The DATEDIF function converts the comparison into completed years, months, or days.
Click the cell where you want the elapsed years to appear.
Type =DATEDIF(A2,B2,"Y"), replacing A2 with the start-date cell and B2 with the end-date cell.
Press Return. Excel displays the number of completed years between the two valid dates.

Verify the dates and avoid direct date subtraction
Use this method if DATEDIF still returns an error or if the result comes from a formula such as =B2-A2.
Calculate Completed Years Between Dates in WPS Spreadsheet
WPS Spreadsheet lets you use the DATEDIF function to calculate completed years, months, and days between two dates. Enter your date values, use the correct unit in the formula, and review the result in a familiar spreadsheet interface.
- 1. Open the workbook in WPS Spreadsheet: Launch WPS Office, select Spreadsheet, and open your Excel .xlsx or .xls file.
- 2. Check the date cells: Select each source cell and use Home > Number Format > Date to confirm the start and end values are valid dates.
- 3. Enter the DATEDIF formula: Click an empty result cell and enter =DATEDIF(A2,B2,"Y"), replacing the references with your own start and end date cells.
- 4. Choose another time unit if needed: Change "Y" to "M" for completed months or "D" for completed days, then press Enter to calculate.

Frequently Asked Questions
Why does subtracting two dates in Excel return a number like 36550?
Excel stores dates as serial numbers. A formula such as =B2-A2 returns the number of elapsed days between the dates, which can be a large number.
What formula calculates completed years between two dates in Excel?
Use =DATEDIF(start_date,end_date,"Y"). For example, =DATEDIF(A2,B2,"Y") returns the number of full years between the dates in A2 and B2.
How do I calculate completed months or days with DATEDIF?
Use =DATEDIF(A2,B2,"M") for completed months or =DATEDIF(A2,B2,"D") for total completed days. The start date must be earlier than the end date.
Why does my DATEDIF formula return an error?
Check that both referenced cells contain valid dates and that the first date is earlier than the second. Format the cells through Home > Number Format > Date to help confirm the values.




