Formatting Issues

How to Fix DATEDIF Results Displayed as a Date in Excel

Huma Ashraf ChHuma Ashraf Ch Nov 4, 2026 870 views

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.

How to Fix DATEDIF Results Displayed as a Date in Excel
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.
Before you start

Ensure you have selected the specific cell or range of cells containing the DATEDIF formula before applying any formatting changes.

Solution 1Recommended

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'.

1
Select the result cell

Click on the cell containing your DATEDIF formula that currently shows the incorrect date format.

2
Open the Number Format dropdown

Navigate to the 'Home' tab on the ribbon. In the 'Number' group, click the dropdown menu that currently says 'Date'.

3
Select General or Number

Choose 'General' to remove all specific formatting, or choose 'Number' and decrease the decimal places to zero so it displays as a whole number.

Change the Cell Number Format to General or Number
Quick Shortcut: You can quickly open the Format Cells dialog by pressing Ctrl + 1 on your keyboard, then navigating to the 'Number' tab to change the format.
Calculate Dates Easily with WPS Spreadsheet

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. 1. Open your spreadsheet in WPS: Launch WPS Office and open your workbook in the Spreadsheet application.
  2. 2. Enter the DATEDIF formula: Type =DATEDIF(start_date, end_date, "d") into an empty cell to calculate the difference in days.
  3. 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.
100% compatible with Microsoft Excel formulas and formatsIntelligent cell formatting for date and time calculationsLightweight, fast, and completely free to use
microsoft office alternative - wps office

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.