Excel Flash Fill, Remove Duplicates and Conditional Formatting: Clean a Messy Sheet in Minutes

Three built-in Excel features that turn a 1,000-row mess into a usable table โ€” with the caveats nobody mentions, including the one that deletes data permanently.

3 Excel Tricks That Clean a Messy Spreadsheet (Flash Fill, Duplicates, Formatting)

A spreadsheet rarely arrives clean. Someone exports a customer list, pastes a second list underneath it, adds a column of phone numbers typed three different ways, and then asks you to "just tidy it up". The work that follows is usually an hour of copy-paste, not analysis.

Three features already inside Excel remove most of that hour: Flash Fill copies a pattern you demonstrate, Remove Duplicates deletes repeated rows, and Conditional Formatting makes the remaining problems visible. None of them needs a macro, an add-in or a subscription beyond the one you already have.

This guide covers the exact steps, the order to use them in, and the limits that the menu labels do not mention โ€” including the one feature that deletes data permanently.

How this was researched: every step was performed in desktop Excel for Microsoft 365 on Windows in November 2026, on a 1,240-row test file. Menu names can differ slightly on Mac and in other versions. Excel for the web and Google Sheets do not have every feature described here; the differences are listed in their own section.

The quick checklist

Before you touch the file:

  • Save a copy with a new name. Two of these three features change data, not just its appearance.
  • Make sure row 1 is a real header row, not a title or a blank line.
  • Select the whole table (Ctrl+A inside it) so all columns stay aligned.
  • Check the first ten results after Flash Fill, and the removed count after Remove Duplicates.
  • Format after cleaning, never before โ€” otherwise you highlight problems you are about to delete.
Three cards showing Flash Fill with Ctrl+E, Remove Duplicates under the Data tab, and Conditional Formatting under the Home tab.
Three built-in features, three different risks: Flash Fill guesses, Remove Duplicates deletes, Conditional Formatting only paints.

Why the order matters

The tempting order is to colour the mess first, because colour makes the file look handled. It is the wrong order. Conditional formatting is a view: it highlights duplicates that still exist and dates that are still in the past. If you delete rows afterwards, the highlighting recalculates and the picture changes under you.

A better order is: split and standardise the columns (Flash Fill) โ†’ remove true duplicate rows (Remove Duplicates) โ†’ highlight what is left (Conditional Formatting). Each step makes the next one cheaper, and the last step never destroys anything.

1. Flash Fill: copy a pattern, not a formula

Flash Fill watches what you type in a new column and guesses the rule. Type Sara beside Sara Benali, then Ben beside Ben Osei, press Ctrl + E, and Excel fills the rest of the column with the first names.

A spreadsheet with full names in one column, two typed first names and domains in the next columns, and a Ctrl+E keycap beside the note that Flash Fill writes values, not formulas.
Two examples set the pattern. Flash Fill writes the results as values, so the column no longer updates itself.

Steps

  1. Insert a new column immediately to the right of the data you want to split.
  2. Type the result for the first row, press Enter, then type the result for the second row.
  3. Press Ctrl + E, or go to Data โ†’ Flash Fill.
  4. Read the first ten cells before you trust the rest of the column.

Patterns it handles well

SourceType thisResult
Sara BenaliSaraFirst name from a full name
sara@example.comexample.comDomain from an email address
+33 6 12 34 56 78+33Country code from a phone number
SKU-1042-RED1042Middle segment from a product code
Ben OseiB. OseiInitial plus surname

Patterns must be consistent. One row in a different format is enough to break the guess.

The three limits worth knowing

  • It writes values, not a formula. If the source column changes, the filled column does not. Re-run Flash Fill, or use a real formula such as =LEFT(A2,FIND(" ",A2)-1) when the data changes often.
  • It is a guess. Mixed formats, blank rows in the middle and columns containing several patterns produce wrong answers that look plausible. Check the first ten and the last ten cells.
  • It is desktop-only. Flash Fill is not available in Excel for the web. If you work in the browser, use a formula, Text to Columns, or Power Query.

Dates and numbers are the weak spot. Flash Fill is built for text patterns. For dates, use Data โ†’ Text to Columns with the right date order, or a formula, then verify a sample.

2. Remove Duplicates: permanent, so copy first

This is the feature that removes 54 rows from a 1,240-row list and makes the file usable. It is also the one that cannot be undone once the file is saved.

Two panels comparing a messy email column with duplicate rows marked DUP and a cleaned column where the duplicates are gone.
The before panel shows what Remove Duplicates finds; the after panel shows the same list with 54 rows removed. The row count is the receipt.

Steps

  1. Save a copy of the workbook first. This is not optional.
  2. Click inside the table and press Ctrl + A so the whole table is selected, not one column.
  3. Go to Data โ†’ Remove Duplicates.
  4. Tick My data has headers if row 1 contains the column names.
  5. Choose which columns define a duplicate. All columns means an identical row; one column means "keep the first email address and delete every later row with the same one".
  6. Click OK and read the confirmation: how many were found and how many were removed.

What counts as a duplicate

SelectionWhat happensUse when
All columnsOnly fully identical rows are removedYou suspect the same record was imported twice
One key column (email, order ID)Keeps the first row for each key, deletes the restYou want one row per customer or per order
Two or three columnsDuplicates are defined by that combinationOne row per customer per month, for example

The comparison is case-insensitive: BEN@Example.com and ben@example.com count as the same value. That is usually what you want for emails, and occasionally not what you want for product codes.

Before you click OK

  • Decide which row survives. Excel keeps the first occurrence in the current order. If the newest record matters, sort by date descending first โ€” otherwise you keep the oldest.
  • Blank cells count as values. Rows where the key column is empty can collapse into one, deleting real records that never had an email address.
  • Ctrl + Z usually restores the rows if you have not saved or closed the file. Do not build a workflow that depends on it.
  • Hidden rows are included. If you filtered the table first, check what is hidden before removing anything.

3. Conditional Formatting: see the problem, not the row

Formatting does not clean data. It shortens the time you spend looking for what is wrong, which is often the larger cost.

Highlight duplicates still left

  1. Select the column or the whole table.
  2. Go to Home โ†’ Conditional Formatting โ†’ Highlight Cells Rules โ†’ Duplicate Values.
  3. Choose a fill colour and click OK. Every repeated value is marked, including the first occurrence.

Highlight dates that have passed

  1. Select the date column, starting at the first data row (say D2).
  2. Conditional Formatting โ†’ New Rule โ†’ Use a formula to determine which cells to format.
  3. Enter =$D2<TODAY() and pick a fill. The dollar sign locks the column so the rule follows each row correctly.

Show scale in one column

Data Bars turn a numeric column into a bar chart inside the cells. It is the fastest way to spot an outlier โ€” a 14-hour support ticket among 20-minute ones โ€” without building a chart.

Limits: rules recalculate every time the sheet changes, so tens of thousands of formula-based rules can slow a workbook down. And formatting travels with copied cells: paste a highlighted cell somewhere else and the rule may come with it.

The six-minute routine

  1. Minute 1 โ€” copy and inspect. Save a copy, check the header row, count the rows.
  2. Minutes 2โ€“3 โ€” split columns. Flash Fill for names, domains and codes. Verify the first and last ten cells.
  3. Minutes 4โ€“5 โ€” remove duplicates. Select the whole table, choose the key columns, read the removed count.
  4. Minute 6 โ€” highlight what is left. Duplicates, overdue dates, blanks in required columns.

That sequence is deliberately boring. It is also repeatable, which matters more than clever: the same six minutes work on next month's export.

Where the free versions differ

FeatureDesktop ExcelExcel for the webGoogle Sheets
Flash Fill (Ctrl + E)YesNoNo โ€” use formulas or split text
Remove DuplicatesYesYesYes โ€” Data โ†’ Data cleanup โ†’ Remove duplicates
Conditional FormattingYesYesYes โ€” Format โ†’ Conditional formatting
CostLicence or Microsoft 365Free with a Microsoft accountFree with a Google account

If you only have the free web version, the workflow still works: replace Flash Fill with LEFT, RIGHT, FIND or Text to Columns, then use Remove Duplicates and Conditional Formatting as described. It takes longer to set up once, and it updates automatically afterwards.

Common mistakes

  • Formatting before cleaning. You end up maintaining rules for rows you are about to delete.
  • Removing duplicates on one column without checking the others. You keep the first row for each email, which may be the oldest and least complete record.
  • Trusting Flash Fill on the whole column. It is right most of the time; the ten-row check is what catches the exceptions.
  • Deleting the source columns too early. Keep the original text until the cleaned version has been reviewed by someone else.
  • Assuming a clean file stays clean. The next import brings the mess back. Save the routine, not just the result.

The bottom line

Flash Fill standardises columns, Remove Duplicates deletes repeated rows, and Conditional Formatting shows you what is left. Used in that order, they turn an hour of manual editing into a few minutes of checking โ€” and the checking is the part that keeps the file honest.

If the repetitive part of your week is not a spreadsheet but a writing or reporting task, the guide to automating repetitive tasks with AI covers where automation helps and where a human still has to check the output. And if you need images for the report you just cleaned, start with the AI image prompt formula.

Sources

Frequently asked questions

No. Flash Fill is a desktop feature in Excel for Windows and Mac, including Microsoft 365. In Excel for the web you have to use formulas such as LEFT, RIGHT and FIND, Text to Columns, or Power Query. The results can be identical; the setup takes longer the first time.

Usually yes, with Ctrl + Z, as long as you have not saved or closed the workbook. Once the file is saved, the rows are gone. That is why the guide says to work on a copy and to read the confirmation dialog before clicking OK.

The usual causes are an inconsistent pattern, blank rows inside the range, several different formats in the same column, or data that is mostly numbers and dates rather than text. Give it two clean examples, make sure the column is directly beside the source, and check that the range has no gaps.

No. It only changes how cells look. The duplicate values remain in the data, and any count, sum or pivot table still includes them. Use Remove Duplicates to delete rows, then Conditional Formatting to check that nothing was missed.
Spreadsheets Productivity

A hand-picked toolkit, twice a month

No spam, no fluff. Get the tools and setups that actually helped us, reviewed with first-hand experience.