6 Ways To Clean Messy Dates in Microsoft Excel

Learn how to clean messy dates in Microsoft Excel in tried and tested methods.

Think of messy dates in Excel like a work calendar full of meetings with no times, wrong names, and no clear order. You wouldn’t walk into a meeting without knowing who it’s with or when it starts—and Excel needs the same clarity.

If your dates are not correct, formulas stop working, reports become confusing, and deadlines get missed. I’ve been stuck looking at a messy sheet, thinking, “How do I fix this without going crazy?” This guide shows you the simple and clear ways to clean up your dates fast. Let’s get started!

Using Excel Flash Fill

Flash Fill is a powerful feature in Microsoft Excel, available in versions 2016 and later, that automatically fills in values based on a pattern you start typing.

It’s especially useful for cleaning messy data like inconsistent date formats, as it quickly reformats entries without requiring formulas or complex logic.

If you’re dealing with a column of irregularly written dates and want a fast, beginner-friendly solution, Flash Fill is the perfect method to standardize them effortlessly.

Let me show you how to use this tool using a real-world dataset containing messy dates:

Enter the required date format
Enter the required date format

Click on cell B2, right next to the first messy date in A2, and manually type the correctly formatted date (e.g., if A2 has “26-12-2021” and you want “12/26/2023”, type “12/26/2023” in B2).

Press Enter to move to cell B3, and then go to the Data tab in the Excel ribbon at the top of the screen.

Use Flash Fill
Use Flash Fill

Click on the Flash Fill button located in the Data Tools group of the Data tab, or use the shortcut Ctrl + E on your keyboard.

Cleaned messy dates using Flash Fill
Cleaned messy dates using Flash Fill

Excel will automatically detect the pattern you started in B2 and fill down the remaining cells in column B (B3 to B9) with cleaned-up date formats matching your example.

Review the filled-in results in column B to ensure Excel followed the correct format; if any entry looks wrong, simply correct the first few rows again and repeat Flash Fill.

Once satisfied with the cleaned dates in column B, you can copy and paste them over the original messy data in column A, using Paste Special > Values to replace them without affecting formatting.

Using Format Cells Option

Sometimes, you’ll get datasets with date entries in the Text format. The Text format’s encoding is so unusual that Excel’s Number Formatting command won’t be able to switch the format from Text to Number, Short Date, or so on.

In such a situation, you can get the help of two separate commands of Microsoft Excel to clean messy dates with minimal effort. These are the Text to Columns and Format Cells commands. Let me show you below how to use these features to convert dirty date formats to a useful format.

Convert Text to Column Wizard
Convert Text to Column Wizard

Firstly, go to the source dataset and select the date entries that you need to fix. Then, click on the Text to Columns command in the Data tab.

The Convert Text to Column Wizard will show up.

Column data format
Column data format

Click on the Next button twice until you reach the Column data format dialog box.

Select the Date radio button and change the Date format to a style that you prefer or need, like MDY, which means MM-DD-YYYY.

Click on the Finish button to transform the source dataset instantly.

Converted text based messy dates to numbers
Converted text based messy dates to numbers

The contents of the selected cell range will automatically change to the Number format.

Format Cells
Format Cells

Now, select this output and press Ctrl + 1 to bring up the Format Cells dialog box.

Go to the Custom formatting category in the Number tab of the Format Cells dialog box.

Then, write or copy and paste the preferred Custom Number Formatting code into the Type field. You can use the following code to achieve the Month textMonth numberYear number formatting below:

mmm - dd - yyyy
Cleaned messy dates using Format Cells and Text to Columns
Cleaned messy dates using Format Cells and Text to Columns

As soon as you click on the OK button in the Format Cells dialog box, Excel will automatically save and show the changes.

This method lets you clean date entries in the same column, which is especially useful when the dataset is huge and creating a helper column might reduce the app’s performance greatly.

Using the Find and Replace Tool

The Find and Replace tool in Microsoft Excel is a built-in feature available in all versions of Excel that lets users search for specific characters, text, or symbols and replace them instantly across a selected range or worksheet.

It’s particularly useful for cleaning messy dates that use inconsistent separators, such as dots (e.g., 12.03.2023) or spaces, instead of Excel-recognized formats like slashes or dashes.

This method is fast, doesn’t require formulas, and is ideal for beginners who want to quickly standardize date formats before converting them into valid Excel dates.

Let me introduce you to the quick steps you can follow along with:

Find and Replace
Find and Replace

Select the range A2:A7 where your messy dates are stored.

Press Ctrl + H to open the Find and Replace dialog box.

In the Find what field, enter the character you want to replace. For example, if your dates are written, like 12.03.2023, type a dot (.).

In the Replace with field, enter a hyphen (-) or slash (/). For example, type / if you want Excel to recognize the date using slashes like 12/03/2023.

Changed dates
Changed dates

Click the Replace All button, and Excel will replace all occurrences of the specified character in the selected range.

Cleaned messy dates using Find and Replace
Cleaned messy dates using Find and Replace

After replacing, check that all dates now use a consistent and Excel-recognized format such as dd/mm/yyyy or dd-mm-yyyy.

If Excel still treats the cleaned dates as text, go to the Data tab, click Text to Columns, choose Delimited, and on the final screen, choose Date: DMY to convert the text into real Excel dates.

Once the dates are properly recognized, you can apply custom number formatting if desired (e.g., mmm - dd - yyyy) to control how they are displayed.

Using the Text to Columns Tool

The Text to Columns tool in Microsoft Excel is a built-in feature available in all modern Excel versions. It has been designed to split or convert text-based data into structured columns.

It’s particularly helpful for cleaning messy date entries that Excel treats as plain text. For example, when dates are separated by non-standard characters or are not recognized automatically.

This method is ideal when your dates look like real dates but don’t behave like them in Excel, helping to convert them into true date values that Excel can calculate and format.

Delimited option
Delimited option

Select the range A2:A7 where your messy dates are listed.

Go to the Data tab on the ribbon and click the Text to Columns button in the Data Tools group.

In the wizard that opens, choose Delimited and click Next. Follow this step even if the dates aren’t separated by commas or tabs.

Skip the delimiter options by clicking Next again, since you don’t need to split the column. Your goal is to re-interpret the text as a date.

Date format in Text to Columns
Date format in Text to Columns

On the final screen, under Column data format, choose Date, and from the dropdown, select the correct structure that matches your data. For example, if your dates are written as 26-12-2021, select DMY (day-month-year).

Dates in number format
Dates in number format

Click Finish, and Excel will instantly convert the text into real date values in the number format.

Short Date
Short Date

Now, select the output data and select the Short Date or Long Date format from the Number Formatting drop-down list in the Excel Home tab.

Using TRIM, LEN, MID, & DATEVALUE

When date entries come with multiple unusual characters, delimiters, or spaces, you need to use multiple functions in cascade to extract dates and convert those into a format that can be further used in data analytics and visualization.

Sample dataset 1
Sample dataset 1

Suppose you got a dataset containing inappropriate date formats, like the one shown above in the screenshot.

using TRIM
using TRIM

Now, you can use a combination of TRIM, LEN, MID, and DATEVALUE functions to convert these dates to a professional format, like DD-MM-YY. Let me walk you through the simple steps:

This is the first step where you’ll clean your data. You need to use the following TRIM function to get rid of all the leading and lagging spaces from the given date entries.

In a cell, enter the following formula and hit Enter:

=TRIM(A2)

Make sure you modify the cell reference in the above formula according to your own dataset.

Using fill handle for TRIM
Using fill handle for TRIM

Now, use the fill handle from the first cell, drag it down until data exists in the relevant cell of the source dataset. Excel will replicate the formula in all the cells.

Using LEN function
Using LEN function

Data cleaning is done! Now, you need to find out the character length of all the values in column B, or whichever column in your worksheet.

Using fill handle for LEN
Using fill handle for LEN

To populate the character lengths of all the cells in column B, select the first cell of column C and enter the following formula into it:

=LEN(B2)

Press Enter to calculate the cell. Use the fill handle and drag it down to calculate the character length of the rest of the cells in column B.

Using MID function
Using MID function

Now, use the following formula in the first cell of column D or whichever column in your dataset to extract the date entries and get rid of the asterisks:

=MID(B2,3,C2-4)

Ensure you change B2 and C2 with appropriate cell references from your own worksheet. Here, B2 is essentially the trimmed data, and C2 is essentially the character number of B2.

Hit Enter to calculate D2.

Using fill handle for MID
Using fill handle for MID

Now, use the fill handle of D2 and drag it down to calculate and extract the dates minus the asterisks for the rest of the cells in the column.

Using DATEVALUE
Using DATEVALUE

Finally, use the following formula in E2 and press Enter to calculate the cell:

=DATEVALUE(D2)
Using DATEVALUE fill handle
Using DATEVALUE fill handle

Here as well, you must change the cell reference for DATEVALUE(D2) to a different cell that contains the date entries except the asterisk characters.

Use the fill handle to copy, paste, and calculate the remaining cells in column E.

Applying Short Date format
Applying Short Date format

You should now see the numerical equivalents of all the date entries in column D. Select the column and apply the Short Date or Long Date Number Format from the Number Formatting drop-down menu.

Cleaning messy dates using Excel functions
Cleaning messy dates using Excel functions

Congratulations! You’ve successfully cleaned messy date entries and converted those to usable date formats, like MM/DD/YYYY.

Using Excel Power Query

Power Query is a powerful data transformation and cleaning tool available in Excel 2016 and later (also as an add-in in Excel 2010 and 2013). It allows you to import, clean, and shape data through a user-friendly interface without writing complex formulas.

For cleaning messy dates, Power Query is especially useful when you’re dealing with recurring issues or large datasets. It can standardize date formats efficiently and automatically with just a few clicks.

Create Table dialog
Create Table dialog

Select any cell inside your dataset (e.g., in column A), then go to the Data tab on the ribbon and click From Table/Range in the Get & Transform Data group.

If prompted, confirm the table range and make sure the My table has headers checkbox is unchecked (or checked only if A1 is a header), then click OK.

Split Column
Split Column

In the Power Query Editor, your messy dates will appear in a column; if they’re not recognized as dates, you’ll see them listed as text.

Select the column and click on the Transform tab on the top menu bar. Find and select the Text Column command in the Number Column block.

Select the Split Column option from the drop-down menu and choose By Delimiter from the overflow menu.

Split Column by Delimiter
Split Column by Delimiter

The Split Column by Delimiter dialog box will open.

The delimiter will be automatically selected in the Select or enter delimiter field. If not, click on the drop-down menu and choose the appropriate delimiter.

Click OK, and Power Query will split the Messy Dates column into three new columns.

Custom Column
Custom Column

Now, go to the Add Column menu and click on the Custom Column command.

Enter a name in the New column name field and type in the following Power Query formula into the Custom column formula field:

Text.PadStart(Text.From([Messy Dates.1]), 2, "0") & "/" &
Text.PadStart(Text.From([Messy Dates.2]), 2, "0") & "/" &
Text.From([Messy Dates.3])

Enter the appropriate data columns into the formula in the following order:

  • [Month]
  • [Date]
  • [Year]

You can change the order of the referred columns based on the date format you want. In this exercise, I’m showing the MM/DD/YYYY date formatting.

Click OK to create the custom column. You should see that Power Query has successfully combined and formatted the numbers in three different columns into a single date column of MM/DD/YYYY format.

Close and Load To
Close and Load To

Once the data looks clean and properly formatted, click Close & Load To in the Home tab to send the cleaned dates back to a new worksheet in Excel.

Import data
Import data

Choose the Existing worksheet option on the Import Data dialog box and select the cell in the top left corner of the destination cell range. Click OK.

Cleaned date using Power Query
Cleaned date using Power Query

You can now delete all the columns in the worksheet except for the Clean Date column.

You can now apply number formatting or use the cleaned dates in calculations, and if your original data updates later, you can simply refresh the query to clean the new entries automatically.

Conclusions

So far, you have learned the six best methods to clean messy dates in Excel that you often get from external software and databases.

These methods serve different data transformation and cleaning requirements. The easiest method is using Flash Fill. Though it’s not available in Excel editions earlier Excel 2016.

Did you like the Excel guide and have learned something new today? Use the comment box given below to share your feedback. Don’t forget to share the guide with your colleagues and friends to help them learn Excel effortlessly.

About the Author

Tamal Das

Tamal Das

I'm a freelance writer at HowToExcel.org. After completing my MS in Science, I joined reputed IT consultancy companies to acquire hands-on knowledge of data analysis and data visualization techniques as a business analyst. Now, I'm a professional freelance content writer for everything Excel and its advanced support tools, like Power Pivot, Power Query, Office Scripts, and Excel VBA. I published many tutorials and how-to articles on Excel for sites like MakeUseOf, AddictiveTips, OnSheets, Technipages, and AppleToolBox. In weekends, I perform in-depth web search to learn the latest tricks and tips of Excel so I can write on these in the weekdays!

Related Posts

Comments

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Get the Latest Microsoft Excel Tips

Follow Us

Follow us to stay up to date with the latest in Microsoft Excel!

Subscribe for awesome Microsoft Excel videos 😃