How-to recipes · Dates and times
How to convert text to a date in Excel
Turn dates stored as text into real Excel dates with DATEVALUE, DATE with LEFT, MID and RIGHT, or Text to Columns, and fix day-month mix-ups.
Dates exported from other systems, CSV files and web pages often land in Excel as text that only looks like a date. The signs are easy to spot once you know them: the values are aligned to the left, formulas that subtract them return #VALUE!, SUMIFS with a date range returns 0, sorting puts 02.04.2026 before 15.03.2026, and a PivotTable will not group them into months. Converting them into real dates (serial numbers) fixes all of these at once.
How to check
Use =ISNUMBER(A2). A real date is a number, so it returns TRUE; a text date returns FALSE. ISTEXT gives the opposite answer. Changing the number format does not convert text into a date, which is why formatting the column as Date appears to do nothing.
The example data
Four texts in A2:A5, all meaning 15 March 2026, in formats you will often meet. The correct result is the date serial number 46096, displayed with a date format.
ISO and system formats: DATEVALUE
DATEVALUE converts text that Excel can recognise as a date into a serial number:
| A | B | C | |
|---|---|---|---|
| 1 | Imported text | ||
| 2 | 2026-03-15 | 2026-03-15 | |
| 3 | 15.03.2026 | ||
| 4 | 20260315 | ||
| 5 | Mar 15 2026 |
DATEVALUE returns 46096; with the cell formatted as a date (yyyy-mm-dd) it shows 2026-03-15.
Result: 2026-03-15
The ISO format yyyy-mm-dd is recognised everywhere. Other formats are recognised only if they match the date order of your computer's regional settings: 03/15/2026 works on a US system and fails on a European one. =--A2 or =VALUE(A2) do the same conversion as DATEVALUE and also keep a time part if there is one.
Any format: rebuild it with DATE
When the format does not match your settings, take the text apart and give the pieces to DATE in the order year, month, day. For the European dotted format:
| A | B | C | |
|---|---|---|---|
| 1 | Imported text | ||
| 2 | 2026-03-15 | ||
| 3 | 15.03.2026 | 2026-03-15 | |
| 4 | 20260315 | ||
| 5 | Mar 15 2026 |
RIGHT takes 2026, MID takes 03 from position 4, LEFT takes 15. Formatted as a date.
Result: 2026-03-15
For compact dates such as 20260315: =DATE(LEFT(A4,4),MID(A4,5,2),RIGHT(A4,2)). This method does not depend on regional settings at all, so the workbook gives the same answer on every computer. It requires a fixed layout: if some days have one digit (5.3.2026), use the Text to Columns method instead.
Microsoft 365: the whole column at once
| A | B | C | |
|---|---|---|---|
| 1 | Imported text | ||
| 2 | 15.03.2026 | 2026-03-15 | |
| 3 | 02.04.2026 | 2026-04-02 | |
| 4 | 28.11.2026 | 2026-11-28 |
One formula converts the column; format the result as dates.
No formulas: Text to Columns
This converts the cells in place and handles variable lengths such as 5.3.2026:
- Select the column with the text dates.
- Data > Text to Columns.
- Choose Delimited and click Next, untick every delimiter and click Next.
- Under Column data format choose Date and pick the order of the text, for example DMY for 15.03.2026 or YMD for 2026-03-15.
- Click Finish. The values turn into real dates and move to the right side of the cells.
This is the best fix for a column where the day and month were mixed up during import, because you tell Excel the true order explicitly.
Month names in the text
Texts like Mar 15 2026 are recognised by DATEVALUE in English versions of Excel. In other languages the month abbreviations differ, so DATEVALUE fails. A robust alternative is to look the month up: =DATE(RIGHT(A5,4),MATCH(LEFT(A5,3),{"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"},0),MID(A5,5,2)) returns 15 March 2026 regardless of language settings.
Pitfalls
- Silent day-month swap. 02.04.2026 can become 4 February instead of 2 April if Excel guesses the wrong order. Check a date with a day above 12; it will either convert correctly or stay as text, which reveals the problem.
- Result shows a number. 46096 is correct: format the cell as a date (Ctrl+Shift+#).
- Leading apostrophes ('2026-03-15) force text. Text to Columns removes them.
- Two-digit years (15.03.26) are interpreted by Windows settings: 00-29 become 2000-2029 and 30-99 become 1930-1999.
- Power Query detects and converts date columns with a locale (Change Type > Using Locale), which is the cleanest fix for recurring imports. See Power Query basics: import, clean, append, merge, refresh.