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.

Intermediate DATEVALUE DATE LEFT MID RIGHT VALUE ISNUMBER ISTEXT

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:

C2fx=DATEVALUE(A2)
ABC
1Imported text
22026-03-152026-03-15
315.03.2026
420260315
5Mar 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:

C3fx=DATE(RIGHT(A3,4),MID(A3,4,2),LEFT(A3,2))
ABC
1Imported text
22026-03-15
315.03.20262026-03-15
420260315
5Mar 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

C2fx=DATE(RIGHT(A2:A4,4),MID(A2:A4,4,2),LEFT(A2:A4,2))
ABC
1Imported text
215.03.20262026-03-15
302.04.20262026-04-02
428.11.20262026-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:

  1. Select the column with the text dates.
  2. Data > Text to Columns.
  3. Choose Delimited and click Next, untick every delimiter and click Next.
  4. 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.
  5. 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.
Tip. The opposite conversion, turning a real date into text for labels and file names, is in How to convert a date to text in Excel. Why dates are numbers is explained in Dates and times: serial numbers, date math and working days.
⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 16 KB

More how-to recipes