How to Convert Text to a Date with DATEVALUE in Excel
Turn text dates from a CSV export into real dates with DATEVALUE, count days between them, and extract a date from a note.
You will learn to
- Convert a text date into a real date
- Subtract two text dates
- Extract and convert a date embedded in text
How it works
Dates imported from CSV files and other systems often arrive as text, which sorts alphabetically and can’t be filtered by month. DATEVALUE(date_text) converts text such as "2026-03-02", "March 9, 2026" or "14-Mar-2026" into a real date serial number.
If the date is buried inside longer text, cut it out first with LEFT, MID or RIGHT: =DATEVALUE(RIGHT(H1,10)) reads the last 10 characters of a note like "Due 2026-04-15". Format the result with a date style to see the date.
=DATEVALUE(B2)