Spreadsheet Practice

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 to B7
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

  1. A23/2/2026

    The value in A2.

  2. ISNUMBER(A2)TRUE

    ISNUMBER: TRUE if the value is a number.

    • valueA23/2/2026
  3. DATEVALUE(A2)#VALUE!not used

    DATEVALUE: Converts date text to a date.

    • date_textA23/2/2026
  4. IF(ISNUMBER(A2),A2,DATEVALUE(A2))46083

    IF: Returns one value if a test is true, another if false.

    • logical_testISNUMBER(A2)TRUE
    • value_if_trueA23/2/2026
    • value_if_falseDATEVALUE(A2)#VALUE!not used

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.

FormulaResultWhen to use it
=--A23/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!

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