DATEVALUE Function
DATEVALUE Function
The DATEVALUE function in Google Sheets converts a date stored as text (a string) into a numeric “serial value” that Sheets can recognize and calculate as a date. It is useful when dates imported from an external CSV file are treated as text, preventing you from sorting them or calculating day differences.
Syntax
=DATEVALUE(date_string)
- date_string: A text string representing a date (enclosed in double quotes, or a reference to a cell containing a text date).
Practical Examples with a Table
This example converts imported text dates (left-aligned strings) into numeric date values and calculates the date 7 days later.
| A (Text Date) | B (After DATEVALUE) | C (Formatted as Date) | D (7 Days Later) | |
|---|---|---|---|---|
| 1 | Text Date | Serial Value | Date Display | 7 Days Later |
| 2 | 2026年11月10日 | =DATEVALUE(A2) |
2026/11/10 | =B2+7 |
| 3 | 2026-11-24 | =DATEVALUE(A3) |
2026/11/24 | =B3+7 |
- Result in B2:
46336(Converted into a numeric serial value) - Display in C2: Applying “Format” > “Number” > “Date” to cell B2 displays
2026/11/10. - Result in D2:
2026/11/17(Once converted to a number, addition works as expected)
Common Errors and Precautions
- When
#VALUE!errors occur:- Occurs if the string cannot be parsed as a valid date (for example, dot-separated
"2026.11.24", a non-existent date like"2026/02/30", or a string containing full-width characters). For dot-separated dates, useSUBSTITUTEto replace dots with slashes before passing the string toDATEVALUE.
- Occurs if the string cannot be parsed as a valid date (for example, dot-separated
- When referencing a cell that is already a numeric date:
- Passing a cell that is already recognized as a numeric date (rather than text) causes a
#VALUE!error.
- Passing a cell that is already recognized as a numeric date (rather than text) causes a
- Handling strings that include a time:
- If you pass a string that includes a time, such as
"2026/11/24 15:30:00", the time portion is discarded and only the integer date serial value is returned.
- If you pass a string that includes a time, such as
Frequently Asked Questions
Q. Why does DATEVALUE show a 5-digit number like '46350'?
A. That is the internal serial value Google Sheets uses to represent dates (the number of days elapsed since December 30, 1899). Changing the cell's number format to 'Date' will display it as '2026/11/24'.
Q. What date string formats can DATEVALUE convert?
A. Standard formats such as '2026/11/24', '2026-11-24', or 'November 24, 2026' can be converted, but dot-separated strings like '2026.11.24' or strings containing full-width characters may result in an error.