Function Problems

Fix Excel DATEDIF Returning a Large Number Instead of Years

Rana GarciaRana Garcia Nov 12, 2026 871 views

Question details

The user needs to calculate the number of completed years between two dates instead of receiving a large numeric result.

Fix Excel DATEDIF Returning a Large Number Instead of Years
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.
Before you start

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.

Solution 1Recommended

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.

1
Select the result cell

Click the cell where you want the elapsed years to appear.

2
Enter the completed-years formula

Type =DATEDIF(A2,B2,"Y"), replacing A2 with the start-date cell and B2 with the end-date cell.

3
Confirm the formula

Press Return. Excel displays the number of completed years between the two valid dates.

Use DATEDIF with the completed-years unit
Use the correct unit: Use "Y" for completed years, "M" for completed months, and "D" for total completed days.
Calculate date differences accurately

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. 1. Open the workbook in WPS Spreadsheet: Launch WPS Office, select Spreadsheet, and open your Excel .xlsx or .xls file.
  2. 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. 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. 4. Choose another time unit if needed: Change "Y" to "M" for completed months or "D" for completed days, then press Enter to calculate.
Use DATEDIF to calculate completed years instead of elapsed serial-number days.Apply Date formatting to confirm that source cells contain valid dates.Open and edit Microsoft Excel .xlsx and .xls workbooks with strong format compatibility.Work in a lightweight, familiar spreadsheet interface.
microsoft office alternative - wps office

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.