DATEVALUE Parameter Cannot Be Parsed to Date/Time in Sheets
Why Google Sheets DATEVALUE can't parse 14/02/2020, why 3/2/2020 silently turns into March 2, and two ways to rebuild day-first text dates safely.
On this page
A column of dates from a bank export or a colleague’s CSV goes into Google Sheets, =DATEVALUE(A2) shows #VALUE!, and the message says: “DATEVALUE parameter ‘14/02/2020’ cannot be parsed to date/time.” A few rows below, the same formula returns a number and looks fine.
Those rows that look fine are the ones to worry about. A spreadsheet set to the United States locale reads a/b/yyyy as month/day, so 14/02/2020 has no month 14 and fails, while 3/2/2020 converts quietly to March 2. If the export is day-first, stop asking DATEVALUE to guess and build the date from its parts:
=DATE(INDEX(SPLIT(A2,"/"),1,3),INDEX(SPLIT(A2,"/"),1,2),INDEX(SPLIT(A2,"/"),1,1))
For 14/02/2020 in A2 it returns 14 February 2020, which a US-locale sheet displays as 2/14/2020. For 3/2/2020 it returns 3 February, not March 2. The rest of this page is about finding every row that needs it, including the ones that never raised an error.
Seven rows, four errors, two wrong answers
Make a new sheet and set column A to Plain text (Format > Number > Plain text) before typing, so Sheets keeps the values exactly as an export would deliver them. Enter this in A1:B8. In A4, type one ordinary space before 21/02/2020. In A8, type the formula =DATE(2020,2,14) instead of text; that cell stands in for a value that is already a real date.
| Posted | Sender meant |
|---|---|
| 14/02/2020 | 2020-02-14 |
| 3/2/2020 | 2020-02-03 |
| 21/02/2020 | 2020-02-21 |
| 14.02.2020 | 2020-02-14 |
| 2020-02-14 | 2020-02-14 |
| 02/03/2020 | 2020-03-02 |
| =DATE(2020,2,14) | 2020-02-14 |
Column B is only a note for comparison. With File > Settings > Locale set to United States, put =DATEVALUE(A2) in C2 and fill it down to C8. DATEVALUE returns a date serial number, so the cells show numbers until you format them as dates:
| Cell | Result | Read as | Correct? |
|---|---|---|---|
| C2 | #VALUE! | error | |
| C3 | 43892 | 2 Mar 2020 | wrong |
| C4 | #VALUE! | error | |
| C5 | #VALUE! | error | |
| C6 | 43875 | 14 Feb 2020 | yes |
| C7 | 43864 | 3 Feb 2020 | wrong |
| C8 | #VALUE! | error |
C3 and C7 are the costly ones. Both have a day and a month of 12 or less, so DATEVALUE swapped them and gave no sign of it. Fixing only the #VALUE! cells leaves March 2 sitting where 3 February belongs, and it will sort, filter and total as March.
The leading space in A4 is not what broke it. In the same US file, " 2/14/2020" and "2/14/2020 " with ordinary spaces both converted to 43875; A4 fails because 21 is not a month.
C8 is also #VALUE!, and the message is “DATEVALUE parameter ‘43875’ cannot be parsed to date/time.” DATEVALUE does not accept a serial number in a Plain text cell. Use =VALUE(A8) or =A8*1 instead: both returned 43875, and after Format > Number > Date they displayed 2/14/2020.
To list the rows that were at risk in a day-first column, flag every value whose first two parts are both 12 or less. In D2, for slash dates:
=AND(INDEX(SPLIT(A2,"/"),1,1)<=12,INDEX(SPLIT(A2,"/"),1,2)<=12)
It returns FALSE for A2 and A4 and TRUE for A3 and A7. Every TRUE row is one that a month-first reading could have swapped without complaint.
What the DATE and SPLIT rebuild returns on the sample
SPLIT breaks 14/02/2020 into 14, 2 and 2020 as numbers. INDEX picks the third, second and first piece, and DATE receives them as year, month and day. Filled from E2 to E8, the formula from the top of the page returns:
| Cell | Result |
|---|---|
| E2 | 2/14/2020 |
| E3 | 2/3/2020 |
| E4 | 2/21/2020 |
| E5 | #REF! |
| E6 | #REF! |
| E7 | 3/2/2020 |
| E8 | #REF! |
The display is month-first because the file’s locale is United States; the values are 14 February, 3 February, 21 February and 2 March. Format the column as yyyy-mm-dd (Format > Number > Custom date and time) if you want a display nobody can misread.
The three #REF! rows say “Function INDEX parameter 3 value is 3. Valid values are between 0 and 1 inclusive.” SPLIT found no slash, so there was no third piece. That is a useful tell: E5 has dots, E6 is ISO, and E8 is a real number with nothing to split. You can confirm the last one with =ISNUMBER(A8), which returns TRUE, while =ISNUMBER(A2) returns FALSE and =ISTEXT(A2) returns TRUE. A cell that is already a date doesn’t need converting at all; reference it directly.
Changing the locale fixes new parsing, not old dates
The other repair is to tell the whole file that dates are day-first. In a test file switched from United States to United Kingdom, every DATEVALUE formula recalculated straight away. 14/02/2020 became 14 February, 3/2/2020 became 3 February, and 02/03/2020 became 2 March. 14.02.2020 still returned #VALUE!, and a month-first 2/14/2020 that had worked before now returned #VALUE! as well.
The side effect is in dates that were typed, not formulas. Before the switch, 3/2/2020 was typed into a normal cell, and Sheets stored 2 March with a m/d/yyyy format. After the switch that cell still held 2 March and still displayed 3/2/2020. Typing 3/2/2020 into the cell below it under United Kingdom stored 3 February with a d/m/yyyy format, which also displays 3/2/2020. Two cells look identical and sit a month apart.
On a private file that holds only one country’s exports, switching the locale is the quickest fix. On a shared sheet I wouldn’t do it. The setting covers every tab, it changes how everyone’s new typing is read, and already-typed dates keep their old meaning behind the same display. A helper column with the DATE and SPLIT formula keeps the rule visible to whoever opens the file next.
Dots, ISO dates and timestamps
The slash formula only handles slashes, so the other rows need their own treatment.
For dotted dates such as A5, split on the dot:
=DATE(INDEX(SPLIT(A5,"."),1,3),INDEX(SPLIT(A5,"."),1,2),INDEX(SPLIT(A5,"."),1,1))
It returns 14 February 2020. Swapping the dots for slashes and calling DATEVALUE doesn’t help: =DATEVALUE(SUBSTITUTE(A5,".","/")) is just 14/02/2020 again and returns #VALUE! in a US file.
ISO text like A6 needs no repair. 2020-02-14 converted to 43875 under both United States and United Kingdom, because year-month-day can only be read one way.
Timestamps are where ISO goes wrong. 2020-02-14T09:30:00Z returned #VALUE! from DATEVALUE, while 2020-02-14 09:30 and 2/14/2020 9:30 converted to 43875 and the time was dropped. For the T…Z form, keep the first ten characters:
=DATEVALUE(LEFT(A12,10))
With the timestamp in A12 this returns 43875, 14 February 2020. It takes the calendar date as written in UTC; it doesn’t convert the moment into your time zone.
A weekday prefix is less of a problem than it looks. In the US file, Friday, 2/14/2020 and Fri 2/14/2020 both converted, while Friday, 14/02/2020 failed for the same reason as A2. In the United Kingdom file that last one converted. The slash formula can’t handle it, though: SPLIT hands DATE the text Friday, 14 and the result is #VALUE!, “Function DATE parameter 3 expects number values.” Strip the weekday first.
Non-breaking spaces and two-digit years
A non-breaking space (character 160) is the one invisible character that did break both approaches. With one in front of 21/02/2020 in A10, =UNICODE(A10) returns 160 for the first character, DATEVALUE fails even for a month-first 2/14/2020, and the slash formula stops at DATE parameter 3 because 21 with that space is text. Clean it before splitting:
=DATE(INDEX(SPLIT(TRIM(SUBSTITUTE(A10,UNICHAR(160)," ")),"/"),1,3),INDEX(SPLIT(TRIM(SUBSTITUTE(A10,UNICHAR(160)," ")),"/"),1,2),INDEX(SPLIT(TRIM(SUBSTITUTE(A10,UNICHAR(160)," ")),"/"),1,1))
It returns 21 February 2020. On its own, =TRIM(SUBSTITUTE(A10,UNICHAR(160)," ")) returns 21/02/2020 with a length of 10, down from 11.
Two-digit years split the two methods apart. DATEVALUE read 2/14/20 in the US file, and 14/02/20 in the United Kingdom file, as 2020. The slash formula on 14/02/20 returned 14 February 1920, because DATE treats a year of 20 as 1920. If every year in the export is in the 2000s, say so in the formula:
=DATE(2000+INDEX(SPLIT(A11,"/"),1,3),INDEX(SPLIT(A11,"/"),1,2),INDEX(SPLIT(A11,"/"),1,1))
With 14/02/20 in A11 it returns 14 February 2020. Don’t use that rule on birth dates or anything else that spans two centuries.
Convert the whole column and check what came out
For A2:A7, one formula in an empty column handles every slash row, cleans character 160 and labels the rest:
=MAP(A2:A7,LAMBDA(d,IF(d="","",IFERROR(DATE(INDEX(SPLIT(TRIM(SUBSTITUTE(d,UNICHAR(160)," ")),"/"),1,3),INDEX(SPLIT(TRIM(SUBSTITUTE(d,UNICHAR(160)," ")),"/"),1,2),INDEX(SPLIT(TRIM(SUBSTITUTE(d,UNICHAR(160)," ")),"/"),1,1)),"Check source date"))))
It spills 43875, 43864, 43882, Check source date, Check source date and 43892. Unlike the single DATE formula, the MAP output came back as plain serial numbers, so format the column as a date. I’d keep the visible label rather than returning a blank: a blank date drops out of a filtered report and nobody notices.
A date coming out is not proof that it is right. DATE quietly rolls impossible parts forward. 31/02/2020 became 2 March 2020, and a month-first 2/14/2020 that slipped into the day-first column became 2 February 2021. Compare the result with the text it came from. With the rebuilt date in E2:
=AND(DAY(E2)=INDEX(SPLIT(A2,"/"),1,1),MONTH(E2)=INDEX(SPLIT(A2,"/"),1,2))
It returned TRUE for A2, A3, A4 and A7. Added as extra rows, 31/02/2020 and 2/14/2020 both returned FALSE. Keep the original text column until those checks pass. A swapped date carries into everything downstream, from an age calculated from a date of birth to the gap reported by the date difference calculator.
If you’re working in Excel instead, the guide to dates stored as text covers its conversion options, and the #VALUE! error guide covers the other inputs that produce this error. For a reference of Sheets date functions, see the date and time cheat sheet.