DATEVALUE
Turn a date written as text into a date serial number.
Syntax
DATEVALUE(date_text) | Argument | Required | Description |
|---|---|---|
date_text | Required | A date written as text, in ISO or US format. |
Examples
Every example below was executed against VisiGrid engine 0.35.0 — not
transcribed from another vendor's documentation. Reproduce any of them with vgrid calc.
| Formula | Result | Notes |
|---|---|---|
=DATEVALUE("2024-03-15") | 45366 | |
=DATEVALUE("3/15/2024") | 45366 | Month-first US format is understood too. |
=DATEVALUE("nonsense") | #VALUE! Cannot parse 'nonsense' as date |
Which formats work
YYYY-MM-DD and M/D/YYYY. Both give the same serial number, so a column that
mixes the two still converts cleanly.
Spelled-out months do not parse. "15-Mar-2024" returns #VALUE! where
Excel would accept it. If your source data looks like that, replace the month
name before converting — SUBSTITUTE will do it, or
fix it at the export.
When you need it
Almost always after an import. A CSV column of dates frequently arrives as text,
which sorts alphabetically, refuses to compare, and quietly breaks any formula
expecting a number. DATEVALUE is the fix, and
ISNUMBER on a sample cell is how you find out you need it.
Stray spaces defeat it, so pair it with TRIM when the
source is untidy.
Excel compatibility
Matches Excel for ISO and US formats. Excel additionally accepts spelled-out months such as "15-Mar-2024", which are not parsed here.