Excel function

DATEVALUEfunction

Converts a date written as text into a date serial number.

All versions
=DATEVALUE("2026-11-18")

Date text10 chars

12
20
32
46
5-
61
71
8-
91
108

Enter a date that does not exist, such as "2026-02-30", to get #VALUE!. Adding " 9:30" at the end is fine; the time is ignored. Try breaking it on purpose to see the errors.

Result

46344

date_text

Text containing a date. This playground reads 2026-11-18, 2026/11/18 and 2026.11.18.

What is the DATEVALUE function?

=DATEVALUE(date_text)

DATEVALUE converts a date written as text, such as "2026-11-18", into an Excel date serial number. Use it when dates imported from elsewhere are text and won't calculate.

Check on the strip above which parts of the text are read as the year, month and day. The result is a number, so format the cell as a date to see it as a date.

Arguments

date_text
Text containing a date. Excel reads the date formats of your regional settings. This playground handles year-month-day order only.

DATEVALUE examples

  1. Example 1. Basic

    =DATEVALUE("2026-11-18")

    46344. With date formatting it shows as 2026-11-18.

  2. Example 2. Slashes

    =DATEVALUE("2026/11/18")

    The same 46344.

  3. Example 3. Difference between dates

    =DATEVALUE("2026-12-25")-DATEVALUE("2026-11-18")

    37 days.

Common mistakes

FAQ

What if there is a time?
The time part is ignored and only the date is returned. Use TIMEVALUE for the time.
What if the year is left out?
Excel fills in the current year from your computer clock. This playground handles formats with a year only.