FormulaCraft

How to convert text to a date in Excel and Google Sheets

Topic:Text manipulation
Excel & Google Sheets
=DATEVALUE(A2)

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Enter the text date string in A2 (e.g., "January 15, 2024" or "2024-01-15").
  2. 2In a result cell, enter =DATEVALUE(A2).
  3. 3The result is a date serial number. Format the result cell as a Date to see the readable date.
  4. 4If DATEVALUE returns an error, the text format may not be recognized. Try using DATE with MID/LEFT/RIGHT to parse the components manually.
  5. 5Once converted, you can use the result in date arithmetic and functions like DATEDIF.

Tips

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

Frequently asked

Why does DATEVALUE return a #VALUE! error?

The text string is not in a format that DATEVALUE recognizes. Common issues include non-standard separators, ambiguous formats like DD/MM/YYYY vs MM/DD/YYYY, or extra spaces. Use TRIM and SUBSTITUTE to clean the string first.

How do I convert dates in a non-standard format like 20240115?

Parse manually: =DATE(LEFT(A2,4),MID(A2,5,2),RIGHT(A2,2)) extracts year, month, and day from an 8-digit YYYYMMDD string.

More on Text manipulation

See all →

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: