How to Clean Up a Messy Spreadsheet
Messy data is one of the most common obstacles to useful analysis. Before you can sort, filter, calculate or visualise information reliably, the underlying data needs to be consistent and well structured. This guide shows you how to identify and fix the most common data quality problems in Excel.
What you will learn
- How to identify common data quality problems in a spreadsheet
- How to remove duplicates and fix inconsistent values
- How to use Excel's text functions to clean up messy text
- How to handle blank cells and missing data
- How to prevent data quality problems from recurring
Introduction: why data quality matters
A spreadsheet is only as useful as the data it contains. If the same value is spelled differently in different rows — 'Housing' in one row and 'housing' in another, or 'N/A' in some cells and blank in others — sorting, filtering and formulas will not work as expected. Cleaning up data before you analyse it is not optional; it is the foundation of reliable results.
Data quality problems are extremely common. They arise when data is entered manually by multiple people, imported from different systems, or accumulated over time without consistent standards. The good news is that Excel has a range of tools to help you identify and fix them.
What does it mean? Common data quality problems
The most common data quality problems in spreadsheets are: duplicate rows, where the same record appears more than once; inconsistent values, where the same thing is written in different ways; leading or trailing spaces, where a cell appears to contain a value but has invisible spaces before or after it; mixed data types, where a column contains both numbers and text; and blank cells, where a value is missing entirely.
Each of these problems causes different issues. Duplicates inflate counts and totals. Inconsistent values mean that filtering for 'Housing' misses rows that say 'housing'. Leading spaces mean that two cells that look identical are treated as different values. Mixed data types cause formulas to return errors or incorrect results.
How does it work? Practical cleaning techniques
To remove duplicates, select your data range and go to Data > Remove Duplicates. Excel will show you how many duplicate rows it found and removed. Always make a copy of your data before removing duplicates — just in case.
To fix leading and trailing spaces, use the TRIM function. In a new column, enter =TRIM(A2) where A2 is the cell you want to clean. TRIM removes all spaces from the beginning and end of a text value, and reduces multiple spaces between words to a single space. Once you have cleaned the values, copy the new column and paste it as values over the original.
To standardise inconsistent text values — for example, to make sure all entries in a Status column use exactly the same capitalisation — use Find and Replace (Ctrl+H). Search for the variant you want to change and replace it with the standard version. For more complex standardisation, the PROPER, UPPER and LOWER functions convert text to title case, upper case and lower case respectively.
A real-world example: cleaning a property data export
The data team at Snips Housing Association received a monthly export from their housing management system containing property records. The export consistently had problems: property types were sometimes 'Flat', sometimes 'flat' and sometimes 'FLAT'; some address fields had leading spaces; and a small number of properties appeared twice with slightly different data.
They created a cleaning checklist: first remove duplicates, then use TRIM on address columns, then use Find and Replace to standardise property type values. By running through this checklist each month before any analysis, they reduced the time spent investigating data errors from several hours to a few minutes.
Try it yourself: clean a sample dataset
Create a small spreadsheet with a Name column and a Status column. Enter ten rows of data, deliberately introducing some problems: type the same name twice with slightly different capitalisation, add a space before one of the status values, and use two different spellings for the same status (for example, 'In Progress' and 'In progress').
Now use the techniques from this guide to clean it up. Use Remove Duplicates to find any duplicate rows. Use TRIM in a helper column to check for leading spaces. Use Find and Replace to standardise the status values. When you are done, your data should be consistent and ready to filter or analyse.
Preventing data quality problems
The best way to deal with data quality problems is to prevent them from occurring in the first place. Data validation in Excel lets you restrict what can be entered in a cell — for example, limiting a Status column to a fixed list of values using a dropdown. To add data validation, select the cells you want to restrict, go to Data > Data Validation and choose List as the validation type.
For data that is collected from multiple people, consider using Microsoft Forms or a Power App instead of a shared spreadsheet. These tools enforce consistent data entry at the point of collection, which means less cleaning work later.
Key takeaways
Clean data is the foundation of reliable analysis. The most common problems — duplicates, inconsistent values, leading spaces and mixed data types — can be fixed using Excel's built-in tools. Preventing problems through data validation and structured data entry is more efficient than cleaning up after the fact.
Where to go next
With clean data, you can start to explore it. The next guide covers sorting, filtering and finding information in Excel.
Sorting, filtering and finding information in Excel →