Excel cleaning is straightforward once you decide on a repeatable order of operations: back up the file, remove merged cells and blank rows, trim stray spaces, force dates and numbers into real values, delete duplicates, then validate with a quick audit before you trust any formula or pivot table. That sequence is what people mean by "excel cleaning bros" — a small set of checks done in the same order every time, so a messy export becomes a table you can filter, sort and analyse without surprises. This guide applies to Excel for Microsoft 365 on Windows, Mac and Excel for the web; menu labels can differ slightly by version, device or region, so look for the closest match.
What You'll Need
- A copy of the workbook — never clean your only file. Save a duplicate as filename_RAW.xlsx before touching anything.
- Excel or Excel for the web with the Power Query add-in if you plan to automate imports (it is built in on recent versions).
- Familiarity with the Home, Data and Find & Select controls.
- About 10 minutes per 10,000 rows for a first pass, longer if you have free-text fields.
Step-by-Step
- Save a clean copy and freeze the original. Open the file, click File > Save As, and give the copy a new name. If you ever corrupt a formula or overwrite a column, you can fall back to the untouched original instead of rebuilding.
- Convert the range to a real table. Select any cell in your data and press Ctrl+T (Cmd+T on Mac). Confirm the range and tick "My table has headers". Tables give you structured references, auto-expanding ranges and the ability to filter everything at once. If your data has no headers, add clear ones first — blanks in row 1 break table creation.
- Unmerge every merged cell. Press Ctrl+F, go to Options > Format > Alignment and choose Merge cells, then find each one. On the Home tab, click Merge & Center to split them. Merged cells break sorting, filtering, pasting and Power Query imports. After unmerging, fill down the value that belonged to the whole block so nothing is lost — select the empty cells under the value, press Ctrl+G, click Special > Blanks, then type the value and press Ctrl+Enter.
- Delete blank rows and columns. Filter any column, untick Select All, tick (Blanks), then delete the visible rows. Alternatively select the whole data region, press F5, click Special > Blanks, and delete entire rows. Remove empty helper columns at the edges too, since trailing blanks create phantom data ranges in pivots.
- Trim stray spaces. Leading, trailing and double spaces cause lookups to fail. Add a helper column with =TRIM(A2), copy it down, then copy the result and use Paste Special > Values over the original column. For non-breaking spaces (common in web exports), wrap it: =TRIM(SUBSTITUTE(A2,CHAR(160)," ")). Delete the helper column afterwards.
- Force numbers and dates into real values. Numbers stored as text show a green triangle or align left. Select the column, go to Data > Text to Columns, and click Finish — that single pass usually converts them. Watch for thousand separators, currency symbols and comma-vs-dot decimals; Text to Columns lets you set those explicitly. For dates, use Text to Columns with the correct date order (DMY or MDY) rather than regional guessing. A date is real when it aligns right and can be formatted.
- Standardise inconsistent text. Use Find & Replace (Ctrl+H) to fix variants like "USA" and "U.S.A." or trailing periods. On the Data tab, use Data > Remove Duplicates only after you are satisfied your categories are spelled consistently — otherwise "New York" and "New york" survive as two separate values. Data > Text to Columns, or the Flash Fill shortcut Ctrl+E, can separate a full name into first and last name columns.
- Remove duplicate rows. Select the table, go to Data > Remove Duplicates and choose which columns define a duplicate. Easy rule: select all columns if a duplicate record means every field matches, or select just the key columns (customer ID, order number, email) if you want one row per entity. Copy the table to a scratch sheet first so you can compare the row count before and after.
- Handle errors and outliers. Use Find & Select > Go To Special > Formulas > Errors to locate #N/A, #DIV/0! and #VALUE! cells. Replace hard-coded gaps with a deliberate blank or a 0, not a space. For outliers, filter each numeric column and scan the top and bottom values; a delivery date before the order date or an age of 300 is a fix, not a statistic.
- Audit before you analyse. Check that every column has one data type, count unique IDs with =COUNTA(UNIQUE(range)) where supported, and confirm totals against the raw file. Freeze the header row with View > Freeze Panes and add a short note on the sheet saying what was cleaned and when. Only then build your pivot table or dashboard.
Common Mistakes
- Cleaning the original file. Every operation becomes irreversible the moment you save over the raw export.
- Deleting blanks blindly. Blanks inside a table can be legitimate; deleting them can misalign merged report sections. Check whether the blank means "missing" or "same as above" first.
- Rounding before merging. Switching a column to two decimal places only changes display — the underlying value stays. Use ROUND if you need the stored number to change.
- Converting dates by eye. Typing dates by hand in a different order silently swaps day and month for values where both are under 12.
- Removing duplicates by the whole row. Two real orders for the same customer on the same day look identical; use a unique order ID instead.
- Trusting a filter count. Filters and some counts ignore hidden rows and blank cells; verify totals with a pivot table.
Tips
- Set up Power Query (Data > Get & Transform Data) for recurring imports — once you record the trim, type and duplicate steps, each new file cleans itself with Refresh.
- Name your ranges and tables meaningfully (SalesData, Customers) so formulas read clearly and survive row insertions.
- Keep a colour legend or a hidden "changes" column documenting manual edits.
- Use conditional formatting to highlight duplicates (Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values) to spot problems before deleting.
- Clean one thing per pass, save, and check row counts after every destructive step.
Troubleshooting
- Numbers won't sum after conversion. Select the range and look for green triangle warnings; if any remain, run Text to Columns again and confirm no leading apostrophe is present in the cell.
- TRIM leaves spaces. The text likely contains a non-breaking space. Use SUBSTITUTE with CHAR(160) before TRIM.
- Dates show as text no matter what. Check for trailing spaces or a leading apostrophe; delete the apostrophe or run Text to Columns with the date option set.
- Remove Duplicates deleted too much. Undo with Ctrl+Z immediately, or restore the previous version via File > Info > Version History if the workbook is saved to OneDrive or SharePoint.
- Pivot totals disagree with the sheet. Refresh the pivot (Data > Refresh All) and check whether the source range missed new rows — tables fix this automatically.
- File is sluggish. Delete unused sheets, remove stale conditional formatting and pivot caches, and split very large files by year or region.
Frequently Asked Questions
Do I need macros to clean Excel data?
No. Tables, Text to Columns, TRIM, Remove Duplicates and Power Query cover most routine cleaning without any code. Use Power Query before VBA because it is easier to inspect and reuse.
Can I clean multiple files the same way?
Yes — point Power Query at a folder and apply the same transformation steps to each file, then combine them into one query.
Why did my lookup fail after cleaning?
Usually because one side is text and the other is a number, or because of hidden spaces. Wrap the lookup in TRIM or convert the column type so both match.
Is Excel for the web's cleaning identical to desktop?
Most features are present, but some advanced options and add-ins are desktop-only. If a menu step is missing, do that step in the desktop app.
Should I delete blank cells or fill them?
If blank means zero, enter 0. If it means unknown, leave it blank or use a marker such as "Not recorded" — both prevent accidental averaging and chart distortion.