Excel Data Cleaning: Complete Steps from Import to Organization

Organizing a raw table exported from a system or copied from a PDF requires first understanding its structure and standardizing its format, then splitting, deduplicating, and validating it. This article gives the complete Excel data-cleaning steps in order, and explains how to extract a table first when it is locked inside a PDF.

Key Points of This Article

  • Save a copy before cleaning, and do all deletions and replacements on the copy so the original is preserved for traceability.
  • Merged cells and subtotal rows in the middle of the data break filtering and pivot tables, so unmerge them or delete them first.
  • Numbers stored as text cannot be summed, and dates stored as text cannot be sorted, so convert the data types first.
  • Before removing duplicates, identify an ID column that distinguishes each record; otherwise you may accidentally delete records whose other columns contain different information.
  • If the table comes from a PDF, export it to Excel before cleaning, which reduces misaligned rows and columns.

If you export a table from a system, or copy a batch of data out of a PDF, you often run into these problems when you open it in Excel: some dates are text and others are numbers; the same customer name is written in three different styles; blank rows and subtotal rows are mixed in; and a single cell contains two fields, "Beijing Chaoyang." If these issues are not dealt with, filtering, pivot tables, and charts will all produce errors later on.

This article is for people who need to turn raw spreadsheets into analyzable data, such as administrative staff who prepare reports, students doing survey research, and operations staff who take over someone else's tables. After reading it, you will have a fixed sequence to follow: first back up the file and understand its structure, then standardize the format column by column, and finally deduplicate, split, and validate. When a table comes from a PDF, you will also know how to extract the data first.

How to Clean Data in Excel? One-Sentence Conclusion

The core of data cleaning is to make each row represent one record, each column hold only one kind of information, and keep the same type of content written consistently. Before getting started, think clearly about what the table will be used for, since different goals call for keeping and removing different content.

Your situationRecommended PracticesCause
Need to create a pivot table or chartOrganize into a standard table with one record per row and no duplicate column names.Pivot tables rely on properly structured fields; merged cells will cause the statistics to be misaligned.
The table comes from a system export, and its format is messy.First make a copy of the original, and do the processing on the copy.Deletion and replacement are often hard to reverse, so keeping the original makes it easier to trace back.
Data comes from a PDF tableConvert to Excel first, then start cleaning.Copying directly is prone to misalignment; converting first preserves the row and column structure.
The data has only a few dozen rows.Manually edit, then use filtering to apply it.The benefits of the official tool and the batch tool are not significant.
Similar tables need to be cleaned repeatedly every month.Record the steps as a checklist, and fix the process with formulas as much as possible.Every time I redo it manually, it's easy to miss steps.

Before You Begin: Confirm These Points

  1. Keep the original file: Save a separate copy and perform all cleaning on the copy. After deleting duplicates or doing batch replacements, it is very hard to restore the original state.
  2. Understand the table structure: Check for merged cells, multi-level headers, and subtotals and notes in the middle of the data. These break filtering and formulas, so they need to be split apart or removed first.
  3. Determine the meaning and type of each column: Distinguish dates, amounts, IDs, and plain text. Numbers stored as text cannot be summed, and dates stored as text cannot be sorted chronologically.
  4. Settle on consistent formats: For example, decide whether company names use full names or short names, and standardize dates to "YYYY-MM-DD". If the same entity is written in different ways, statistical results will be split into multiple groups.
  5. Identify the data source: If the data comes from a PDF, first try selecting a passage of text. If you can select it, the text layer exists and you can convert it directly. If you cannot select it, it is most likely an image, and you will need to run OCR first.

Complete Steps for Organizing Raw Data in Excel

  1. Import the data: If the source is a CSV or text file, use Excel's data import feature and specify the data type for each column, so that ID numbers and codes starting with 0 are not truncated.
  2. Delete useless rows and columns: Remove the explanatory text above the header, blank rows, total rows, and columns that are entirely empty. Do this step first so that the range of subsequent operations is clean.
  3. Split merged content: If one cell contains multiple fields (such as "Beijing-Chaoyang-Jianguo Road"), use the Text to Columns feature to split them into separate columns by delimiter. Conversely, when you need to combine content, use a concatenation formula.
  4. Standardize text: Use TRIM to remove leading, trailing, and extra spaces; use CLEAN to remove invisible characters introduced when copying from web pages or PDFs; then use Find and Replace to unify full-width and half-width characters, letter case, and common aliases.
  5. Convert data types: Convert numbers stored as text into numeric values, and unify various date formats into true dates. You can use VALUE, DATEVALUE, or the date format option in the Text to Columns feature.
  6. Handle blank values and anomalies: Use filters to find blank cells, and decide one by one whether to fill, flag, or delete them. Then identify values outside a reasonable range, such as negative amounts or an age of 200.
  7. Remove duplicate records: First determine which columns can uniquely distinguish each record (such as an order number), then run Remove Duplicates. If you select only some columns, rows that differ in other columns may also be deleted, so read the prompt carefully before proceeding.
  8. Organize into a standard table and save as a new file: Make sure each column has only one header and there are no merged cells, then save as a new file. You may add a column recording the cleaning date or data source to make future verification easier.

When the data is in a PDF, extract the tables first

Tables copied directly from a PDF into Excel often run into two common problems: columns get misaligned, and line breaks get split apart. A safer approach is to restructure the data first, then proceed with the steps above.

  • After opening the PDF, use the PDF editor from OmniDoc Desktop Client to export it to Excel, and check whether the exported rows and columns match the original table.
  • If the file is a scanned document, first use the OCR function to recognize the text, then export. The recognition results may mistake "0" for "O" or "1" for "l", so amounts and serial numbers must be checked item by item.
  • If misalignment remains after exporting, you can return to the spreadsheet and fix it using the text-to-columns or merge-cells methods, without needing to re-enter all the data manually.

Verify each item after completion

Checklist itemsHow do you see it?What should I do if I have a problem?
Is the number of lines reasonable?Compare with the number of original records, and use a filter to view the number of valid rows.The difference is large, which indicates an accidental deletion. Re-run the process from the original file.
Can numbers be summed?Select a column and check the sum shown in the status bar.The result is 0 or only a count, which means it is still text. Go back to step 5 and convert it.
Can dates be sorted?Sort the date column in ascending order and check whether the order is correct.Sorting is messed up, indicating the text contains dates; convert them uniformly.
Is the identity column duplicated?Check whether an ID column contains duplicates using counting formulasDuplicates still remain. Check whether they're due to different wording, and go back to step 4 to unify them.
Spot-check against the originalRandomly sample 5 lines and compare them item by item with the original file.If there is any inconsistency, return to the corresponding step and correct it; pay particular attention to verifying the OCR and exported content.

❓ Frequently Asked Questions (FAQ)

1. Which functions are commonly used for cleaning data in Excel?

Commonly used ones include TRIM, CLEAN, VALUE, DATEVALUE, IF, and COUNTIF. Most data cleaning tasks can be completed with these functions, and more complex logic can be added gradually.

2. Could data cleaning corrupt the original data?

Yes, especially deleting rows, removing duplicates, and bulk replacement. So before you start, save a copy, and save a version each time you finish a major step.

3. Why do the numbers look normal, but the sum is 0?

This is usually numbers stored as text. They are left-aligned, may have a green triangle in the upper-left corner, and need to be converted to numeric values before they can be used in calculations.

4. The table is very large and Excel processes it slowly. What should I do?

First delete the unused columns and blank areas, reduce unnecessary formulas, and then process in batches. Once the steps are clear, you can also record each step so that it can be reused.

5. What is the difference between data cleaning and data analysis?

Cleaning makes data usable, including standardizing formats and removing errors and duplicates; analysis draws conclusions from clean data. The more thorough the cleaning, the more reliable the subsequent analysis.

📝 Summary

How to do data cleaning in Excel: the key is to work in order. First back up the file and understand the structure, then standardize text, convert data types, handle anomalies and duplicates, and finally verify each item. When the table comes from a PDF, convert it first and clean it afterward, which saves a lot of time on manual corrections.

Open OmniDoc and process your spreadsheet files

Updated 2026-11-29