Fix Excel DATEDIF #VALUE! Errors Caused by Text Dates
Question details
Convert text dates into valid spreadsheet dates so DATEDIF can calculate the difference between them.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet uses DATEDIF to calculate the number of days between two dates.
- Observed behavior
- DATEDIF returns #VALUE! when a referenced date is stored as text or cannot be interpreted using the expected regional date order.
Identify the cells containing the start and end dates and confirm the intended date order in the source data. In an empty cell, use =ISNUMBER(A2) to check whether A2 is already stored as a numeric date.
Convert text dates with Excel Text to Columns
Use this method to convert a column of text dates when you know whether the source uses month-day-year or day-month-year order.
Select the cells containing the text dates, then choose Data > Text to Columns.
In the wizard, choose Delimited and click Next twice to reach the Column data format options.
Select Date and choose MDY for month-day-year text or DMY for day-month-year text. Click Finish, then repeat for the other date column if needed.
Confirm the converted dates represent the intended days. Then enter =DATEDIF(A2,B2,"d"), where A2 is the start date and B2 is the end date.

Convert recognized date text with DATEVALUE
Use a formula when the text date format is recognized by Excel's regional settings.
Convert text dates and use DATEDIF in WPS Spreadsheet
Open your workbook in WPS Spreadsheet, convert recognized text dates with DATEVALUE, and calculate the difference with DATEDIF.
- 1. Open the workbook: Open WPS Spreadsheet and select Open to choose your Excel workbook.
- 2. Convert both dates: If A2 and B2 contain recognized text dates, enter =DATEVALUE(A2) in C2 and =DATEVALUE(B2) in D2.
- 3. Verify the results: Select C2 and D2 and apply a date format using the Home tab's number-format controls. Check that both dates match the source data.
- 4. Calculate the days: In an empty cell, enter =DATEDIF(C2,D2,"d"). If DATEVALUE does not recognize the text, check the source date order and regional settings.

Frequently Asked Questions
How can I tell if a date is stored as text?
Enter =ISNUMBER(A2) in an empty cell. TRUE indicates A2 contains a number, as Excel dates normally do; FALSE indicates it is not a numeric date.
Why does changing the cell format not fix DATEDIF?
A date format changes how a numeric date appears; it does not necessarily convert text into a date. Use Data > Text to Columns or DATEVALUE to convert the value.
Which date order should I choose for 3/30/2022?
Choose MDY if the source means March 30, 2022. The value cannot be a valid DMY date because there is no 30th month.
What happens if the start date is after the end date?
DATEDIF returns #NUM! when the start date is later than the end date. Check the referenced cells and their order in =DATEDIF(start_date,end_date,"d").
Why can DATEVALUE return #VALUE! for a date that looks valid?
The text may not match a date format recognized by Excel's regional settings. Check the source format and use Data > Text to Columns with the appropriate MDY or DMY order.




