beginner 6 min read

DATEVALUE Function in Google Sheets

Learn how to use the DATEVALUE function in Google Sheets to convert text to a date. Fix text dates from imports, CSVs, and pasted data with examples.

SB

Sheets Bootcamp

February 24, 2026 Β· Updated November 5, 2026

Reviewed by Ryan

Quick Answer

=DATEVALUE(A2) converts a date stored as text into a real date. For the text β€œ8/1/2018” it returns the serial number 43313, which shows as 8/1/2018 once you apply Format > Number > Date. Check a cell first with =ISNUMBER(A2): TRUE means it already holds a real date, FALSE means it is text that needs converting.

DATEVALUE in Google Sheets converts a date stored as text into a real date value. When you import data from CSVs, copy dates from emails, or receive data from external systems, the dates often arrive as text strings that look like dates but cannot be used in formulas. DATEVALUE fixes this by turning text like β€œ8/1/2018” into a date that works with date functions like YEAR, DATEDIF, and EDATE.

This guide covers the DATEVALUE syntax, how to detect text dates, step-by-step conversion examples, and formulas for handling mixed data.

In This Guide

Syntax

Formula
=DATEVALUE(date_string)

Returns a date serial number from a text string that represents a date.

ParameterDescriptionRequired
date_stringA text string in a recognized date format (e.g., β€œ8/1/2018” or β€œAugust 1, 2018”)Yes

Important

DATEVALUE returns a serial number, not a formatted date. Google Sheets stores dates as numbers internally (days since 12/30/1899). Format the result cell as Format > Number > Date to see a readable date.

Try it yourself

Question 1 of 3

3 quick questions. No account needed.

In B9, use ISNUMBER to check whether the date in B3 is a real date or text.

A
B
C
D
E
F
G
H
I
J
1
2
3
4
5
6
7
8
9
10
11
Order
Placed
Amount
Rep
P-501
3/9/2026
240
Jo
P-502
3/11/2026
95
Al
P-503
March 15, 2026
180
Jo
P-504
3/20/2026
310
Mo
P-505
2026-03-24
75
Al
P-506
Mar 30, 2026
150
Mo
Result
B9

How to Detect and Fix Text Dates: Step-by-Step

Text dates are one of the most common data problems in Google Sheets. They look identical to real dates but break every formula that tries to use them. Here is how to find and fix them.

How to Tell if a Date is Text

Real dates align to the right in a cell. Text dates align to the left. But the most reliable test is ISNUMBER:

Formula
=ISNUMBER(A2)

If the result is TRUE, the cell contains a real date. If FALSE, the cell contains text.

Sample Data

For this walkthrough, we will use a small table with dates in different formats, some imported as text, some as real dates.

Sample data with text dates and real dates in Google Sheets

1

Identify text dates in your data

Open your spreadsheet. In column A, you have date values that may be real dates or text. Enter in cell B2:

Formula
=ISNUMBER(A2)

Copy down the column. Cells with real dates return TRUE. Cells with text dates return FALSE. This is the fastest way to audit an imported dataset for date problems.

ISNUMBER returning FALSE for text dates and TRUE for real dates

2

Convert text dates with DATEVALUE

Select cell C2 and enter:

Formula
=DATEVALUE(A2)

For a text value of β€œ8/1/2018”, DATEVALUE returns the serial number 43313. Format the cell as a date (Format > Number > Date) and it displays as 8/1/2018.

DATEVALUE converting text date to serial number 43313

Copy the formula down. Each text date converts to a real date value.

3

Handle mixed data with ISNUMBER

When your column has a mix of real dates and text dates, use an IF wrapper to handle both:

Formula
=IF(ISNUMBER(A2), A2, DATEVALUE(A2))

This checks whether A2 already contains a real date. If yes, it passes the value through unchanged. If no, it converts the text with DATEVALUE. This formula works safely on every row regardless of whether the date is real or text.

IF formula handling both real dates and text dates in one column

4

Verify the conversion works

Test the converted dates with a date function. Enter in cell E2:

Formula
=YEAR(C2)

YEAR returns 2018. YEAR also reads date-looking text, so it would return 2018 for the original text too. For the real test, enter =ISNUMBER(C2): TRUE confirms the cell holds a real date.

Accepted Date Formats

DATEVALUE recognizes most common date formats. The function uses your spreadsheet’s locale setting to interpret ambiguous formats.

Text InputResult (US locale)
β€œ8/1/2018”8/1/2018
”08/01/2018”8/1/2018
”August 1, 2018”8/1/2018
”1-Aug-2018”8/1/2018
”2018-08-01”8/1/2018
”Aug 1, 2018”8/1/2018

Note

Ambiguous dates depend on your locale. In the US, β€œ01/02/2018” means January 2. In the UK or EU, it means February 1. Check your locale at File > Settings > Locale if DATEVALUE returns unexpected results.

Practical Examples

Bulk Convert Imported Dates

When you import a CSV and all dates arrive as text, convert the entire column with ARRAYFORMULA:

Formula
=ARRAYFORMULA(DATEVALUE(A2:A9))

This converts all 8 text dates at once. Place this in a single cell and it fills down automatically. Format the output cells as dates.

Clean Dates with Extra Spaces

Imported data sometimes has leading or trailing spaces. DATEVALUE fails on ” 8/1/2018” (note the space). Wrap with TRIM first:

Formula
=DATEVALUE(TRIM(A2))

TRIM removes extra spaces, leaving clean text that DATEVALUE can parse.

Convert and Calculate in One Step

Skip the helper column by nesting DATEVALUE inside a date function. To calculate years since a text date:

Formula
=DATEDIF(DATEVALUE(A2), TODAY(), "Y")

This converts the text date and calculates the year difference in a single formula. For β€œ8/1/2018”, this returns the number of full years since that date.

Extract Year from a Text Date

YEAR reads date-looking text on its own, so =YEAR(A2) already works on β€œ8/1/2018”. Wrap with DATEVALUE to make the conversion explicit:

Formula
=YEAR(DATEVALUE(A2))

For β€œ8/1/2018”, this returns 2018, the same as =YEAR(A2).

Common Errors and How to Fix Them

#VALUE! Error

DATEVALUE returns #VALUE! when the text is not in a recognized date format.

Common causes:

  • The text contains an unrecognized format like β€œ2018.08.01”
  • The cell has extra characters or hidden spaces
  • The text includes a time component that confuses parsing

Fix: Check the cell content with =LEN(A2) to detect hidden characters. Use =TRIM(CLEAN(A2)) to remove invisible characters and spaces before passing to DATEVALUE.

Result is a Number, Not a Date

You enter =DATEVALUE(A2) and the cell shows 43313 instead of 8/1/2018.

Fix: The value is correct. Select the cell and go to Format > Number > Date. Google Sheets stores all dates as serial numbers, the cell format controls how they display.

DATEVALUE Applied to a Real Date

You enter =DATEVALUE(D2) where D2 already contains a real date. DATEVALUE returns the same date serial, so nothing breaks, but the conversion does nothing. You get #VALUE! only when D2 holds a plain number with no date format.

Fix: If D2 is already a real date, use it directly, no conversion needed. Use =ISNUMBER(D2) to confirm.

Tips and Best Practices

  1. Always test with ISNUMBER first. Before building conversion formulas, check which cells actually need conversion. =ISNUMBER(A2) is the definitive test for whether a value is a real date.

  2. Use paste as values to replace text dates permanently. After converting with DATEVALUE, copy the result column, paste as values over the original column (Ctrl+Shift+V), then delete the helper column. This replaces text dates with real dates in place.

  3. Watch for locale mismatches. If your data was created in a different locale, the date format may be ambiguous. β€œ01/02/2018” could be January 2 or February 1. Verify a few known dates after conversion.

  4. Combine DATEVALUE with TRIM and CLEAN. Imported data often has invisible characters. =DATEVALUE(TRIM(CLEAN(A2))) handles most text-cleaning scenarios in one formula.

  5. DATEVALUE ignores the time portion. If your text contains both date and time (e.g., β€œ8/1/2018 2:30 PM”), DATEVALUE extracts only the date. Use TIMEVALUE for the time part.

Frequently Asked Questions

How do I convert text to a date in Google Sheets?
Use =DATEVALUE(A2) where A2 contains a date stored as text. DATEVALUE converts text like "8/1/2018" into a real date value that works with date functions and date math.
How do I know if a cell contains a date or text?
Use =ISNUMBER(A2). If the result is TRUE, the cell contains a real date. If FALSE, the value is text that looks like a date but cannot be used in date calculations without conversion.
What date formats does DATEVALUE accept?
DATEVALUE accepts most common formats including "8/1/2018", "August 1, 2018", "2018-08-01", and "01-Aug-2018". The function uses your spreadsheet locale to interpret the format. Ambiguous dates like "01/02/2018" depend on your locale, US interprets this as January 2, UK as February 1.
Why does DATEVALUE return a number instead of a date?
DATEVALUE returns a date serial number because Google Sheets stores all dates as numbers internally. Format the cell as a date (Format > Number > Date) and it displays as a readable date. The serial number 43313 displays as 8/1/2018.
Can DATEVALUE convert a date with a time component?
No. DATEVALUE only handles the date portion and ignores time. For text that includes both date and time like "8/1/2018 2:30 PM", DATEVALUE extracts only the date. Use TIMEVALUE separately if you need the time component.

You read about Date Functions. Now type it.

Unit 1 of the course is free: 6 short lessons in a grid that checks every formula. They teach the Google Sheets skills you'll actually use.

Start the course free

First 6 lessons free. No card needed. See plans

Keep going

Continue learning

Unit 2 is next. Get full access

Practice this in the app

Practice Date Functions

Spot an error on this page? Tell us.

First 6 lessons free. No credit card required.

Start the course free
Continue learning

Cookie policy Β· Privacy policy