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
Example 1. Basic
=DATEVALUE("2026-11-18")46344. With date formatting it shows as 2026-11-18.
Example 2. Slashes
=DATEVALUE("2026/11/18")The same 46344.
Example 3. Difference between dates
=DATEVALUE("2026-12-25")-DATEVALUE("2026-11-18")37 days.
Common mistakes
A date that does not exist
A date such as "2026-02-30" gives #VALUE!. DATE rolls extra days into the next month, but DATEVALUE does not.
The result looks like a number
That is normal. Format the cell as a date.
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.