Module 7: Advanced Excel Data Cleaning Techniques
Module 7: Advanced Excel Data Cleaning Techniques
Introduction
So far, you have learned how to remove duplicates, correct missing
information, clean text, format dates and numbers, sort records,
and use filters.
But what happens when you have thousands of rows of information?
Cleaning each row manually can take a lot of time.
Microsoft Excel provides advanced tools and functions that help you
clean large amounts of data more quickly and accurately.
In this module, you will learn how to use Flash Fill, Find and Replace,
Text to Columns, conditional formatting, Excel Tables, and useful
formulas to identify and correct data problems.
Learning Objectives
By the end of this module, you should be able to:
- Use Flash Fill to recognise and complete data patterns.
- Use Find and Replace to correct repeated mistakes.
- Separate information using Text to Columns.
- Highlight unusual or incorrect entries with Conditional Formatting.
- Use formulas to identify data problems.
- Convert ordinary data ranges into Excel Tables.
- Combine different cleaning techniques in one worksheet.
1. Using Flash Fill to Clean Data
Flash Fill is an Excel feature that recognises a pattern in your
data and automatically fills the remaining cells using that pattern.
Imagine you have a list of students with their first names and
surnames in one column. You want to separate the first names.
Instead of typing every name manually, you can use Flash Fill.
Example
| Full Name |
First Name |
| Adeola Johnson | Adeola |
| Chinedu Okafor | |
| Fatima Bello | |
| David Williams | |
How to Use Flash Fill
- Enter Adeola in the first cell under First Name.
- Move to the next empty cell in the same column.
- Go to the Data tab.
- Click Flash Fill.
- Excel will try to recognise the pattern and fill the remaining names.
You can also use the keyboard shortcut
Ctrl + E on Windows.
Remember: Always check the results after using
Flash Fill. Excel may misunderstand a pattern if the information
is not consistent.
2. Using Find and Replace
Find and Replace helps you locate repeated words, numbers, or
characters and replace them with the correct information.
Imagine a company has entered the word "Lagos" incorrectly as
"Lagoss" in 200 customer records. Correcting each entry manually
would take time.
Find and Replace can help you locate and correct the repeated error.
How to Use Find and Replace
- Open your Excel worksheet.
- Press Ctrl + H on your keyboard.
- Enter the incorrect word in the Find what box.
- Enter the correct word in the Replace with box.
- Click Replace All to correct all matching entries.
Example
| Incorrect Entry |
Correct Entry |
| Lagoss | Lagos |
| Ibadan Cityy | Ibadan City |
| Abujja | Abuja |
Important: Be careful when using Replace All.
Check that the replacement will not change correct information.
It is a good idea to make a backup copy before replacing many entries.
3. Separating Information with Text to Columns
Sometimes, different pieces of information are stored together
in one cell. Text to Columns helps you separate them into different
columns.
For example, a customer database may store full names in one column.
You may want to separate first names and surnames.
Example
| Full Name |
| Samuel Adeyemi |
| Mary Johnson |
| Chuka Okafor |
How to Use Text to Columns
- Select the column containing the full names.
- Open the Data tab.
- Click Text to Columns.
- Choose Delimited.
- Click Next.
- Select Space as the delimiter.
- Click Next and choose the destination if necessary.
- Click Finish.
Excel will separate the names at the spaces and place the results
into different columns.
Other Uses:
Text to Columns can also separate information divided by commas,
semicolons, tabs, or other characters.
4. Using Conditional Formatting to Find Data Problems
Conditional Formatting changes the appearance of cells when they
meet conditions you choose. It can help you identify unusual values
quickly.
Imagine a teacher wants to identify examination scores below 40.
Instead of checking every score manually, the teacher can highlight
those scores automatically.
How to Highlight Scores Below 40
- Select the cells containing examination scores.
- Open the Home tab.
- Click Conditional Formatting.
- Choose Highlight Cells Rules.
- Select Less Than.
- Enter 40.
- Choose a formatting style.
- Click OK.
Excel will highlight all scores below 40 using the selected style.
Other Ways to Use Conditional Formatting
- Highlight duplicate values.
- Highlight numbers greater than a selected value.
- Highlight dates within a particular period.
- Use colour scales to compare high and low values.
- Highlight blank cells using a formula-based rule.
Important: Conditional Formatting helps you spot
possible problems. It does not automatically correct the data.
Always investigate highlighted records before making changes.
5. Using Excel Formulas to Check Data
Excel formulas can help you find missing information, check text
length, remove extra spaces, and identify unusual entries.
A. Using COUNTBLANK
COUNTBLANK counts the number of empty cells in a selected range.
Formula:
=COUNTBLANK(A2:A20)
This formula counts all empty cells between A2 and A20.
B. Using LEN
LEN counts the number of characters in a cell. It is useful when
checking phone numbers, identification codes, or other information
that should have a fixed length.
Formula:
=LEN(A2)
If cell A2 contains 08012345678 stored as text, LEN returns 11.
If it returns a different number, you may need to investigate the entry.
C. Using TRIM
TRIM removes unnecessary spaces from text, including extra spaces
between words.
Formula:
=TRIM(A2)
For example, " Mary Johnson " becomes "Mary Johnson".
D. Using IF
IF checks whether a condition is true or false and returns a result
based on that condition.
Formula:
=IF(B2>100,"Check Score","Valid")
If the score in B2 is greater than 100, Excel displays Check Score.
Otherwise, it displays Valid.
E. Using ISBLANK
ISBLANK checks whether a cell is empty.
Formula:
=IF(ISBLANK(A2),"Missing Information","Available")
This formula displays Missing Information if A2 is empty.
Otherwise, it displays Available.
6. Converting Data into an Excel Table
An Excel Table makes information easier to organise, filter,
format, and manage. It is especially useful when working with
large datasets.
How to Create an Excel Table
- Select your data, including the column headings.
- Press Ctrl + T on your keyboard.
- Check the My table has headers option if your data has headings.
- Click OK.
Excel will convert your selected information into a table.
Dropdown filter arrows will appear beside the headings.
Benefits of Excel Tables
- They make filtering and sorting easier.
- They automatically extend when you add new rows.
- They provide consistent formatting.
- They make formulas easier to manage.
- They help organise large amounts of information.
7. Combining Advanced Cleaning Techniques
In real projects, you may need to use several Excel tools together.
No single tool can solve every data problem.
Imagine a training company in Nigeria has collected information
from 1,000 learners. The records contain:
- Names with unnecessary spaces.
- Repeated spelling mistakes.
- Full names stored in one column.
- Missing phone numbers.
- Incorrect examination scores.
- Different date formats.
A Suggested Cleaning Process
- Make a backup copy of the original spreadsheet.
- Use TRIM to remove unnecessary spaces.
- Use Find and Replace to correct known repeated spelling errors.
- Use Text to Columns to separate full names where appropriate.
- Use Flash Fill to complete recognised patterns.
- Use COUNTBLANK and ISBLANK to locate missing information.
- Use LEN to check phone number lengths.
- Use Conditional Formatting to highlight suspicious scores.
- Use Data Validation to prevent future incorrect entries.
- Convert the cleaned dataset into an Excel Table.
Real-World Example:
A business in Ibadan can use these techniques to clean its customer
database before sending marketing messages or preparing sales reports.
Clean customer records help reduce mistakes and improve communication.
8. Practical Exercise
You have been asked to clean a small learner database for CRMNuggets.
The information below contains several data problems.
| Full Name |
Phone Number |
Score |
| Adeola Johnson | 08012345678 | 85 |
| Mary Bello | 0801234567 | 110 |
| Chinedu Okafor | | 72 |
| Fatima Yusuf | 08123456789 | 45 |
| David Williams | 08098765432 | 95 |
Your Tasks
- Use TRIM to remove unnecessary spaces from names.
- Use Text to Columns to separate first names and surnames.
- Use LEN to check the length of each phone number.
- Use COUNTBLANK to find missing phone numbers.
- Use an IF formula to identify scores above 100.
- Use Conditional Formatting to highlight scores below 50.
- Convert the cleaned information into an Excel Table.
Challenge:
Create a new column called Data Status. Use Excel formulas to
identify records with missing phone numbers or scores above 100.
Display a suitable message for each record.
Module Summary
In this module, you have learned how to:
- Use Flash Fill to complete data based on patterns.
- Use Find and Replace to correct repeated mistakes.
- Separate information with Text to Columns.
- Use Conditional Formatting to highlight suspicious values.
- Use COUNTBLANK, LEN, TRIM, IF, and ISBLANK formulas.
- Convert ordinary data ranges into Excel Tables.
- Combine different techniques to clean larger datasets.
Module Assessment
Question 1
Which Excel feature automatically fills information based on a recognised pattern?
- Flash Fill
- Filter
- Sort
- Print
Question 2
Which keyboard shortcut opens Find and Replace?
- Ctrl + P
- Ctrl + H
- Ctrl + T
- Ctrl + E
Question 3
Which Excel tool separates information stored together in one column?
- Conditional Formatting
- Text to Columns
- Data Validation
- Freeze Panes
Question 4
Which formula counts empty cells in a selected range?
- LEN
- TRIM
- COUNTBLANK
- SUM
Question 5
What does the TRIM function do?
- Adds numbers
- Removes unnecessary spaces from text
- Deletes entire rows
- Changes dates
Question 6
Which function counts the number of characters in a cell?
- LEN
- IF
- COUNTBLANK
- MAX
Question 7
Which Excel feature can highlight scores below 40 automatically?
- Text to Columns
- Conditional Formatting
- Flash Fill
- Find and Replace
Coming Up in Module 8
You are almost at the end of this course!
In the final module, you will complete a practical data cleaning
project. You will work with a dataset, identify problems, apply
the techniques you have learned, and produce a cleaner spreadsheet.
Keep practising. Data cleaning is an important skill for
anyone who wants to work with Excel, data analysis, or business information.