How to Fix DATEDIF Results Displayed as a Date in Excel
Question details
The user needs to correct the output format of a DATEDIF formula that incorrectly displays the numeric day count as a calendar date.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Calculating the number of days between two dates using the DATEDIF function.
- Observed behavior
- The formula result is displayed as a date (such as 1902/06/17) instead of the actual number of days calculated.
Ensure you have selected the specific cell or range of cells containing the DATEDIF formula before applying any formatting changes.
Change the Cell Number Format to General or Number
Applying a standard numeric format prevents Excel from interpreting the difference in days as a calendar date.
When Excel calculates the difference between two dates using DATEDIF, it may automatically apply the date formatting of the source cells to the result cell. Since the result is a raw day count, formatting it as a date produces unintended calendar dates like '1902/06/17'.
Click on the cell containing your DATEDIF formula that currently shows the incorrect date format.
Navigate to the 'Home' tab on the ribbon. In the 'Number' group, click the dropdown menu that currently says 'Date'.
Choose 'General' to remove all specific formatting, or choose 'Number' and decrease the decimal places to zero so it displays as a whole number.

Use WPS Spreadsheet for Accurate Date Calculations
WPS Spreadsheet offers full support for the DATEDIF function and seamlessly handles date formatting. You can easily calculate days, months, or years between dates without format-switching hassles.
- 1. Open your spreadsheet in WPS: Launch WPS Office and open your workbook in the Spreadsheet application.
- 2. Enter the DATEDIF formula: Type =DATEDIF(start_date, end_date, "d") into an empty cell to calculate the difference in days.
- 3. Format the cell: Right-click the result cell, select 'Format Cells', and choose 'General' under the Number tab to display the exact day count.

Frequently Asked Questions
Why does Excel show my number of days as a year like 1902?
Excel stores dates as sequential serial numbers starting from January 1, 1900. If your formula result is 898 days, and the cell is formatted as a date, Excel interprets '898' as the 898th day after January 1, 1900, which falls in the year 1902.
What are the correct arguments for the DATEDIF function?
The syntax is =DATEDIF(start_date, end_date, unit). The unit must be enclosed in quotation marks and can be "Y" for years, "M" for months, or "D" for days between the two dates.
Can I apply the 'General' format to an entire column at once?
Yes. Click the column letter at the top of the worksheet to select the entire column, then choose 'General' from the Number Format dropdown on the Home tab. All formulas in that column will now display as numbers.




