Skip to content

Clean data

Automated Excel Cleanup Without Losing Formulas or Formatting

A practical order for cleaning messy Excel data, from structure and types through duplicates and validation, while protecting the original workbook.

TidyCell

Choose a cleanup task

Choose duplicate removal, splitting, comparison or row archiving for the job you need.

Choose a task →

Cleaning an Excel workbook is a sequence of decisions. First understand the table, then fix values and types, then review duplicates. Keep the original file so you can compare every result and recover formulas, formatting, or rows that a conversion would otherwise lose.

1. Save an untouched copy

An Excel workbook can contain much more than a visible grid: formulas, charts, pivot tables, named ranges, hidden sheets, and formatting. A CSV export keeps one flat sheet of values. Before using any cleanup method that rebuilds the file, decide whether those workbook features must survive.

2. Identify the real table and headers

Reports often begin with titles, blank rows, notes, or totals above and below the data. Find the actual header row and remove only rows you have confirmed are not records. Check that each column has one meaning and each row represents one record.

3. Make blanks and text consistent

Leading and trailing spaces, non-breaking spaces, inconsistent capitalization, and multiple spellings of one category can split what should be a single group. Normalize only after inspecting examples: CA and California might mean the same state, while two similar customer names might be different people.

4. Fix types with the column's purpose in mind

Amounts should be numbers Excel can sum. Dates should be real dates with an unambiguous convention. Customer IDs, ZIP codes, and product codes may need to stay text so leading zeroes survive. For a detailed treatment, see numbers stored as text.

5. Separate packed fields

Split combined values when later work needs the pieces independently. A comma-delimited address is different from a fixed-width code; choose a method that fits the actual pattern and keep exceptions visible. See the column-splitting guide.

6. Review duplicates last

Repeated names or IDs can represent legitimate multiple transactions. Decide which columns define a duplicate and whether the rows truly repeat the same record before deleting anything. Duplicate keys are especially important before matching and merging sheets.

7. Validate the result

Compare row counts, key totals, formulas, and a sample of changed cells against the original. A trustworthy cleanup can explain what changed and what it left alone. If a transformation would flatten a workbook, use it only when a flat output is what you actually need.

Make recurring cleanup repeatable with Power Query

Import a copy using Data → Get Data, promote the real header row, choose column types deliberately and apply targeted trim, replacement or split steps. Inspect the Applied Steps and error rows. Load the cleaned table into a new sheet rather than replacing the source. Refresh uses those same steps on later exports; check that the new export still has the expected headers and types. Power Query rebuilds the output table rather than preserving input-cell formulas and styling.

Common questions

Can I clean data without changing formulas?

Yes, if the chosen method edits only intended input cells and preserves the workbook structure. Check the output in Excel before replacing the original.

Should I remove every blank row?

Only after identifying the table. Blank rows can separate report sections, and deleting them can shift formulas or ranges.

Choose a focused TidyCell task from Clean a file: duplicate removal, column splitting, file comparison or row archiving. Each task has its own review and workbook-preservation boundaries; none is a universal cleanup pass.