How to Clean Data in Excel: Step-by-Step Guide
Learn how to clean data in Excel for analysis: remove duplicates, fill blanks, fix text-stored numbers, trim spaces and standardize categories, with checks.
A messy spreadsheet can produce wrong averages, split categories and pivot tables that quietly leave out rows. If you need to clean data in Excel for analysis, the problem is usually not one big error. It is a set of small issues: duplicate rows, blank cells, numbers stored as text, extra spaces and labels spelled three different ways. Each one looks minor until a chart or total goes wrong.
This guide gives you a general workflow for cleaning a messy sheet before you analyze it. It covers duplicates, blanks, text versus numbers, stray spaces and consistent categories, in that order, followed by checks to confirm the result. The steps use standard Excel practice. If your file came from a PDF table, the desktop client can export it to Excel first, which is covered in the FAQ.
How do you clean data in Excel for analysis? The short answer
Work on a copy, fix one type of problem at a time, and check the totals before and after each change. Each problem has a different fix, so the table below shows what to do for common situations.
| Your situation | What to do | Why |
|---|---|---|
| The same record appears twice | Remove duplicates using the columns that identify a record, such as ID and date | Repeated rows inflate counts and sums |
| Numbers are left-aligned or sort oddly | Convert text to numbers, then recheck the column | Excel cannot add or average values stored as text |
| Labels like "NY", "New York" and "new york " all appear | Trim spaces, then replace variants with one standard label | Analysis tools treat each variant as a separate category |
| Some cells in a key column are empty | Decide per column: fill, flag, or leave blank on purpose | Blanks silently drop rows from some calculations |
| You are not sure what changed | Keep the raw sheet untouched and log each step | You can rerun or undo a single step without starting over |
Before you start
Preparation takes a few minutes and prevents most of the common regrets in data cleaning.
- Keep the raw data untouched. Save a copy of the file, or copy the raw sheet into a new tab. Cleaning often removes information you may need later, and a copy lets you compare.
- Decide what one row represents. A row might be one order, one patient visit or one survey response. Duplicates and blanks only make sense relative to that definition.
- Look at the headers. Each column should have one header in one row, with no merged cells above the data. Merged cells break sorting and filtering.
- Note the rules for your categories. Write down the standard labels you want, such as "United States" rather than "USA" or "U.S.". This avoids guessing in the middle of the work.
- Check where the data came from. A CSV export, a copied web table and a PDF table often have different problems. If you need the desktop client to get a PDF table into Excel, download it from download.omnidoc.top.
Cleaning an Excel sheet for analysis, step by step
- Make a working copy and set up the range. Save the file under a new name, then convert the data to a table or add filters to the header row. Filters make it easy to see every value in a column.
- Find and remove duplicates. Use Excel's built-in duplicate removal and select only the columns that identify a record, such as order ID and date. Removing based on every column can keep near-duplicates that differ only by a stray space.
- Decide what to do with blanks. Filter each key column for empty cells and look at them. Fill a blank only when you can justify the value, flag it with a note column, or leave it blank and handle it in your analysis. Do not delete rows just because one optional field is empty.
- Convert numbers stored as text. Look for numbers that are left-aligned, show a warning marker or refuse to sum. Use Excel's conversion option on the selected cells, or multiply by 1 in a helper column and paste the values back. Convert only columns that should be numeric, because product codes and ZIP codes should stay as text.
- Remove stray spaces and hidden characters. In a helper column, apply TRIM to the text, which removes leading, trailing and repeated spaces. CLEAN removes non-printing characters that often come from web or PDF copies. Once the results look right, copy them and paste as values over the original column.
- Standardize categories. Filter the column to list its unique values, then group the variants by hand. Use find and replace to map each variant to your standard label. For a column that people will keep filling in, consider a drop-down list through data validation so new entries match the standard.
- Check the data types and ranges. Confirm dates are real dates, not text that looks like dates, and that numeric columns contain no stray letters. Sort each numeric column once to spot outliers or entries that are obviously wrong, such as an extra zero.
- Save the cleaned version and record what you did. Keep the raw file, the cleaned file and a short list of the changes, such as "removed 14 duplicate rows by order ID." That list is what lets you explain your numbers later.
If you prefer to open the file in OmniDoc, the desktop client includes UniCell spreadsheets, which can open and edit the file. The steps above are general Excel practice, so they work the same way in any spreadsheet tool that supports these operations.
Check the result
Cleaning is only useful if the output is correct. Run these checks before you analyze anything.
| Check | How to see it | If it's wrong |
|---|---|---|
| Row count | Compare the number of data rows with the raw sheet, minus the duplicates you removed on purpose | Look for rows removed by accident; restore from your copy and rerun step 2 with narrower columns |
| Totals | Sum a key numeric column in both raw and cleaned files, after accounting for removed duplicates | If the total dropped unexpectedly, check for text-stored numbers that were skipped |
| Category counts | Use a filter or count unique values in the standardized column | Find remaining variants and map them to the standard label |
| Blanks | Filter key columns for empty cells and count them | Decide again whether each blank should be filled, flagged or left alone |
| Dates and numbers | Sort the column and check the alignment and format | Convert the affected cells and recheck totals |
Machine-assisted cleaning and mapping can still miss things, so review any value that matters for a decision before you publish a number.
❓ FAQ
1. Can I clean a PDF table in Excel without retyping it?
Yes, if the table is a digital PDF. The desktop client's PDF editor can export to Excel, and you should then run the steps in this guide on the exported file. Check the columns carefully, because a table that wraps across pages or has merged header cells may need manual fixes after export.
2. Is it safe to delete rows with blank cells?
Only when a blank means the row is unusable for your analysis. If a blank is an optional field, deleting the whole row removes valid data from every other column. Flag or fill blanks in key columns first, then decide.
3. How do I keep the cleaning steps the same for next month's export?
Keep the raw export in its own sheet and apply the same steps to each new file. Write the steps down in order, including which columns you deduplicate on and which category mappings you use. Consistent rules matter more than any one run of the process.
4. Will removing duplicates change my pivot tables automatically?
No. A pivot table reflects the data it was built from, so refresh it after cleaning. Check that the source range still covers all the cleaned rows before you trust the results.
📝 Summary
Cleaning data in Excel for analysis works well as a short sequence: back up the raw data, remove duplicates on the right columns, handle blanks, convert text-stored numbers, trim spaces and standardize categories. Finish each stage with a count or total check, and keep a log of your changes so the numbers can be explained later.


