Why does DATEVALUE return #VALUE!?
Formula (Excel and Google Sheets)
=IF(ISNUMBER(A2),A2,DATEVALUE(A2))DATEVALUE only converts text, and the cell already holds a real date. Check first: =IF(ISNUMBER(A2),A2,DATEVALUE(A2)).
- Result on the example
- one result per row in
B2, filled down toB7 - Works in
- Every current version
- Google Sheets
- Same formula
See it work
The formula is already in B2, filled down to B7. Change any input and the result updates, or edit the formula to experiment.
How it works
DATEVALUE accepts text only. Rows 2, 4 and 7 already hold real dates, which are numbers, so DATEVALUE returns #VALUE! for them. ISNUMBER checks first: real dates pass through unchanged, and only the text is converted.
=IF(ISNUMBER(A2),A2,DATEVALUE(A2))Result46083
A23/2/2026The value in A2.
ISNUMBER(A2)TRUEISNUMBER: TRUE if the value is a number.- value
A23/2/2026
- value
DATEVALUE(A2)#VALUE!not usedDATEVALUE: Converts date text to a date.- date_text
A23/2/2026
- date_text
IF(ISNUMBER(A2),A2,DATEVALUE(A2))46083IF: Returns one value if a test is true, another if false.- logical_test
ISNUMBER(A2)TRUE - value_if_true
A23/2/2026 - value_if_false
DATEVALUE(A2)#VALUE!not used
- logical_test
In Google Sheets
The same formula works in Google Sheets: =IF(ISNUMBER(A2),A2,DATEVALUE(A2)). We ran it in Google Sheets mode on the same data and it returns the same results.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =--A2 | 3/2/2026, 3/9/2026, 3/16/2026… | Shortest: arithmetic leaves real dates alone and converts date text. |
| =IFERROR(DATEVALUE(A2),A2) | 3/2/2026, 3/9/2026, 3/16/2026… | Tries the conversion and keeps the original when it fails. It also lets through text that isn't a date at all. |
Common mistakes
- Text that isn't a recognizable date still returns #VALUE!. Those cells need fixing by hand.
- Format the result column as a date, or real and converted dates both show as numbers.
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Why does DATEVALUE return #VALUE!
B2, return a real date whether A2 holds a date or date text. Fill down to B7.Questions
Why does DATEVALUE work on some rows but not others?
It converts text only. The rows that error already hold dates.
How do I convert text that includes a time?
=--A2 keeps the time; DATEVALUE drops it.
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.