DEV Community

Cover image for How to clean messy data in excel, these are simple techniques that work
Vedad Borovac
Vedad Borovac

Posted on

How to clean messy data in excel, these are simple techniques that work

If you work with Excel long enough, you eventually end up staring at a worksheet that looks like a tornado passed through it. Extra spaces, inconsistent formats, random characters, duplicated rows, all the small problems that slow you down when you just want clean, usable data.

The good news?
You don’t need to be an analyst or power-user to fix this stuff. Most of the tools you need are already built into Excel, you just have to know where they are and how to apply them. Let me show you the techniques I use all the time when I’m cleaning messy spreadsheets, step by step, in a way that makes sense even if you’re not technical.

  1. Start by Removing Extra Spaces (It’s More Common Than You Think) One of the biggest sources of “mystery errors” in Excel is the invisible space, before or after a word, or sometimes between words. These invisible characters break lookups, formulas, and sorting.

The easiest fix is the TRIM() function.

If your messy value is in A2, write:

=TRIM(A2)
This removes extra spaces but keeps single spaces between words.
Once the cleaned version appears, copy it → right-click → Paste Values to replace the original.

This single step fixes half of the problems I see people struggle with.

  1. Use Flash Fill to Standardize Formats Instantly Flash Fill is like Excel’s built-in “pattern recognizer.” If your data has different formats, names written differently, phone numbers inconsistent, dates messy — Flash Fill can rebuild everything in a consistent pattern with almost no work.

Here’s how it works:

  1. In a new column, rewrite one value the way you want it.
  2. Start typing the second value.
  3. Excel will automatically suggest a pattern.
  4. Press Enter to accept.

It works for phone numbers, emails, names, ID numbers, anything with a structure. Once you learn Flash Fill, it becomes your fastest cleanup tool.

Once you start cleaning data regularly, you’ll notice that Excel behaves far more predictably on a fully activated Office installation. Many users avoid random crashes and formatting bugs simply by switching to a microsoft office lifetime license, since it gives them a stable, feature-complete environment without subscription limitations.

  1. Remove Duplicates the Right Way (Not Everything Should Be Deleted) Duplicates aren’t always mistakes, sometimes they’re legitimate entries. So before deleting anything, decide what makes a row “unique.”

Once you know that:

  1. Select your whole table.
  2. Go to Data → Remove Duplicates.
  3. Choose the columns that matter (for example, email + order ID).
  4. Confirm.

Excel will keep the first instance and remove any repeats in a controlled, predictable way.

  1. Fix Weird Characters Using CLEAN and SUBSTITUTE Messy data often comes from copy-pasting out of PDFs, websites, or exported systems. You may see symbols, line breaks, or non-printable characters.

Try:

=CLEAN(A2)
This removes hidden characters.
For unwanted symbols (like “-”, “/”, “#”), use:

=SUBSTITUTE(A2, "-", "")
You can chain SUBSTITUTE multiple times if needed.

  1. Convert Numbers Stored as Text Back Into Real Numbers If you ever tried doing math in Excel and got strange results, the issue may be that your “numbers” are actually text.

To fix it:

  1. Select the column.
  2. Look for a small yellow warning symbol.
  3. Click it → Convert to Number. Or use:

=VALUE(A2)
This is the key step for cleaning imported financial data or large CSV exports.

  1. Use Power Query When You Need a More Serious Cleanup If your sheet is truly chaotic with inconsistent columns, mixed formats, missing headers, Power Query is a lifesaver. It lets you:
  • split and merge columns
  • remove blanks
  • filter errors
  • change data types
  • clean and transform hundreds of rows at once

You’ll find it under Data → Get & Transform.

It feels complicated at first, but even basic steps can massively simplify your workflow.

Top comments (0)