Dates imported as text won’t sort, filter, or calculate. DATEVALUE converts a text date into a real one; for stubborn formats (like 20260617), rebuild it with DATE and the text functions.
The example
Text dates (left-aligned) converted to real dates.
| A | B | |
|---|---|---|
| 1 | Text date | Real date |
| 2 | 2026-06-17 | 6/17/2026 |
| 3 | 17/06/2026 | 6/17/2026 |
| 4 | 20260617 | 6/17/2026 |
The formula
The basic conversion:
How it works
DATEVALUE parses recognizable formats; DATE rebuilds the rest:
DATEVALUE(A2)turns a text date Excel recognizes (like"2026-06-17") into a date serial number. Format the cell as a date to display it.- For a packed format like
20260617that DATEVALUE can’t read, slice it apart and rebuild:=DATE(LEFT(A2,4), MID(A2,5,2), RIGHT(A2,2)). - A quick no-formula fix for a whole column: select it, Data → Text to Columns → Finish — Excel often converts text dates in place.
- Tell text dates apart from real ones by alignment: text left-aligns, real dates right-align.
Fastest bulk fix: select the column, then Data → Text to Columns → Finish — or multiply by 1 (=A2*1) and format as a date. Both coerce recognizable text dates to real ones.
Try it: interactive demo
Type a text date; see whether it parses to a real date.
Variations
Packed format (yyyymmdd)
Slice and rebuild with DATE:
Coerce with math
Multiply by 1 (then format as date):
Date and time text
Split with DATEVALUE + TIMEVALUE:
Pitfalls & errors
#VALUE! from DATEVALUE. The text isn’t a format Excel recognizes (often a day/month order that conflicts with your locale). Rebuild with DATE, or fix the order.
Locale matters. "17/06/2026" fails in a US locale (no month 17). Use DATE with explicit parts to avoid ambiguity.
Result looks like a number. A converted date shows as a serial (e.g. 46190) until you apply a Date format.
Practice workbook
Frequently asked questions
How do I convert text to a date in Excel?
Why does DATEVALUE return #VALUE!?
How do I convert a whole column of text dates at once?
Stop fighting formulas. Learn them in a day.
This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class