Ravindra BagaleCourses & study guides मराठी Track your progress

5. Data Cleaning A–Z

5.7 Text Dates and Mixed Date Formats

Convert text dates with DATE, LEFT, MID and RIGHT with example — in 30 seconds

What: When a date arrives as text like "15/11/2026", you cut out the day, month and year and rebuild a real date with DATE.

Why: Text dates cannot be grouped by month or used in EOMONTH. Real dates can.

Tiny example: "15/11/2026" → RIGHT gives 2026, MID gives 11, LEFT gives 15 → a real date 15-11-2026.

First look at the data (before → after):

Convert text dates with DATE, LEFT, MID and RIGHT with example: before and after tables, fictional FreshGo Maharashtra data

Expected result — Real dates in column C (format dd-mm-yyyy)

B: Raw C: Real date =ISNUMBER(C2)
"02/11/2026" 02-11-2026 TRUE
"15/11/2026" 15-11-2026 TRUE
"30/11/2026" 30-11-2026 TRUE

About this data: Teaching sample for a fictional shop “HomeNest Supplies”. Figures and names (e.g. Vikram Rao) are made up for this lesson on text dates and mixed date formats.

Before table and formula as text

Before — Dates exported as text (dd/mm/yyyy)

B: Raw =ISNUMBER(B2)
"02/11/2026" FALSE
"15/11/2026" FALSE
"30/11/2026" FALSE

About this data: Demo table only — not real customer or company data. Built to practise text dates and mixed date formats.

Formula / click path

C2: =DATE(RIGHT(B2,4), MID(B2,4,2), LEFT(B2,2))

Do it step by step:

  1. Type =ISNUMBER(B2) to confirm the date is text (FALSE).
  2. In C2, type =DATE(RIGHT(B2,4), MID(B2,4,2), LEFT(B2,2)).
  3. Format column C as dd-mm-yyyy with Ctrl + 1.
  4. Copy down and check =ISNUMBER(C2) now says TRUE.
  5. For mm/dd/yyyy files, swap the MID and LEFT parts.

Before

Order ID Order Date (raw) What Excel sees
BLK-3301 14-03-2026 Text (left-aligned)
BLK-3302 03/14/2026 Text (US order)
BLK-3303 2026-03-15 Date
BLK-3304 15.03.2026 Text
BLK-3305 16 Mar 2026 Date or text (depends on settings)
BLK-3306 20260317 Number

About this data: Made-up rows so you can copy the pattern for text dates and mixed date formats. Currencies may use ₹, £, € or $.

After

Order ID Order Date
BLK-3301 14-03-2026
BLK-3302 14-03-2026
BLK-3303 15-03-2026
BLK-3304 15-03-2026
BLK-3305 16-03-2026
BLK-3306 17-03-2026

About this data: Fictional worksheet used in class. Safe to edit; nothing here is live production data.

Steps in Excel

  1. Diagnose: =ISNUMBER(B2) – TRUE means a real date. Right-aligned cells are usually real dates.
  2. One consistent text format (all dd-mm-yyyy): select the column › Data › Data Tools › Text to Columns › Delimited › Next › no delimiters › Next › Column data format: Date: DMY › Finish.
  3. Dots: Ctrl + H, replace . with -, then step 2.
  4. Formula for dd-mm-yyyy text (works whatever your PC's date setting):

    =DATE(RIGHT(B2,4), MID(B2,4,2), LEFT(B2,2))

  5. US mm/dd/yyyy text: =DATE(RIGHT(B3,4), LEFT(B3,2), MID(B3,4,2)).

  6. yyyymmdd number: =DATE(LEFT(B7,4), MID(B7,5,2), RIGHT(B7,2)).
  7. DATEVALUE converts text in a format your system understands: =DATEVALUE("16 Mar 2026"). Its result depends on regional settings – so for mixed files prefer the DATE(…) formulas.
  8. Finally format the column dd-mm-yyyy and check =MIN() and =MAX() of the dates look sensible.

For a column with mixed formats, first add a helper column that identifies the pattern (e.g. =IF(ISNUMBER(B2),"date",IF(ISNUMBER(FIND("/",B2)),"US",IF(LEN(B2)=8,"yyyymmdd","dmy")))) and apply the right formula per pattern.

Ravindra Bagale's Tip

03/04/2026 – is it 3 April or 4 March? Many students don't spot this mistake, because Excel accepted both as a "date". If the dates are mixed, ask the source or recognise the pattern from other rows (if a value bigger than 13 appears, that part is the day). After cleaning, check the MIN/MAX date – if you see a future date, something has gone wrong.

Practice task

Convert a column containing "14-03-2026", "03/15/2026", "16.03.2026" and "20260317" into real dates shown as dd-mm-yyyy. Prove it with =ISNUMBER() and by calculating the weekday of each.

Loading practice tasks...

  1. Is it a real date? (Easy): Is C2 a number (real date)? (TRUE or FALSE)
  2. Get the year (Easy): Take the year text from C2.
  3. Get the day (Easy): Take the day text from C3.
  4. Get the month (Easy): Take the month text from C3.
  5. Build the date (Indian style) (Medium): Make a real date from C2.
  6. Build the date (US style) (Medium): Make a real date from D3.
  7. Build the date (yyyymmdd) (Medium): Make a real date from E4.
  8. Month number of a trip (Medium): Which month (number) is the trip in C5?
  9. Days between two trips (Hard): How many days from trip B-01 (C2) to trip B-02 (C3)?
  10. Do two websites agree? (Hard): Is the C6 date equal to the D6 date? (TRUE or FALSE)
  11. Weekday of a trip (Hard): Which weekday is the trip in E2? (1 = Sunday, 7 = Saturday)

Quick revision cards

Three standalone cards. Each one explains the idea with its own example. Scan the QR to open this lesson.

Revision card 1: What is Text Dates And Mixed Date Formats?
Card 1: What is Text Dates And Mixed Date Formats? · Download PNG
Revision card 2: Tiny example — Text Dates And Mixed Date Formats
Card 2: Tiny example — Text Dates And Mixed Date Formats · Download PNG
Revision card 3: Checklist — Text Dates And Mixed Date Formats
Card 3: Checklist — Text Dates And Mixed Date Formats · Download PNG