DATEVALUE
Parses a date string and returns its date serial number.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=DATEVALUE(date_text)
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
date_text | any | Required | — |
Remarks
- Accepted formats are a fixed supported subset (for example
YYYY-MM-DD,MM/DD/YYYY, and month-name forms). - Parsing is not locale-driven; ambiguous text may parse differently than Excel locales.
- Two-digit years follow Excel's rule:
00-29are 2000-2029,30-99are 1930-1999. - A time after the date is ignored.
- The returned serial uses the workbook's date system (Excel 1900 or Excel 1904).
Examples
Convert an ISO date string to a date serial.
Formula =DATEVALUE("2024-02-29")
Expected result 45351
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Parse a slash-delimited date string.
Formula =DATEVALUE("2/29/2024")
Expected result 45351
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Convert the first day of the 1900 date system.
Formula =DATEVALUE("1900-01-01")
Expected result 1
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Text in an unrecognized date format cannot produce a serial.
Formula =DATEVALUE("not a date")
Expected result #VALUE!
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Parse ISO date
Formula =DATEVALUE("2024-01-15")
Expected result 45306
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Parse month-name date
Formula =DATEVALUE("Jan 15, 2024")
Expected result 45306
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Related functions
FAQ
Why can DATEVALUE disagree with locale-specific Excel parsing?
This implementation uses a fixed set of accepted formats instead of workbook locale settings, so ambiguous text may parse differently.