Hiring Partners
Segilola Resources Operating LimitedTaviatech TechnologiesFCMBMTN NigeriaAdvans La Fayette Microfinance BankAboki AfricaFirst Bank of NigeriaOPay
โ† Data Cleaning in Excel ยท Lesson 7 of 9

Module Six

๐Ÿ“– Every lesson in this course is free to read right here, no account needed. Create a free account to track your progress, take the exam, and earn your certificate.
7
Module 6: Sorting, Filtering, and Validating Data

Module 6: Sorting, Filtering, and Validating Data in Excel

Introduction

Imagine you have a list of 500 students in a school. Their names, classes, examination scores, and phone numbers are stored in Excel. How would you quickly find students in JSS 2? How would you arrange their scores from highest to lowest?

You do not need to search through every row manually. Microsoft Excel provides tools called Sorting, Filtering, and Data Validation to help you organise information and prevent mistakes.

In this module, you will learn how to use these tools to clean and manage data.

Learning Objectives

By the end of this module, you should be able to:

  • Sort information alphabetically and numerically.
  • Arrange dates from oldest to newest.
  • Filter data to display only information you need.
  • Use Data Validation to control what people enter into cells.
  • Identify incorrect entries using Excel tools.
  • Organise a spreadsheet for easier analysis.

1. What Is Sorting in Excel?

Sorting means arranging information in a particular order. You can arrange names from A to Z, numbers from smallest to largest, or dates from oldest to newest.

Excel provides two common sorting options:

  • Ascending: Arranges data from A to Z, smallest to largest, or oldest to newest.
  • Descending: Arranges data from Z to A, largest to smallest, or newest to oldest.

Example: Sorting Student Names

Student Name Class Score
ChineduJSS 275
AminaJSS 188
DavidJSS 365
BolaJSS 292

How to Sort Names from A to Z

  1. Open your Excel worksheet.
  2. Click any cell inside your student table.
  3. Go to the Data tab.
  4. Click Sort.
  5. Select Student Name under the Sort by option.
  6. Choose A to Z.
  7. Click OK.

Excel will arrange the students alphabetically while keeping each student's class and score on the correct row.

Important Tip: Always select the entire data table or allow Excel to expand the selection when sorting. Sorting only one column can separate names from their correct scores and other details.

2. Sorting Numbers and Dates

Sorting Examination Scores

Imagine a teacher wants to identify students with the highest scores. The teacher can sort the Score column from largest to smallest.

  1. Click a cell in the Score column.
  2. Open the Data tab.
  3. Choose Sort Largest to Smallest.
  4. Excel will display the highest scores first.

Sorting Dates

You can also arrange dates in a spreadsheet. For example, a business may want to arrange customer registration dates from the earliest date to the latest date.

  1. Click a date in your table.
  2. Open the Data tab.
  3. Choose Sort Oldest to Newest.
  4. Excel will arrange the dates in chronological order.
Practical Example: A training centre in Ibadan has a list of learners and their registration dates. Sorting the dates helps the centre identify who registered first and who registered recently.

3. What Is Filtering in Excel?

Filtering allows you to display only the information that matches a condition while temporarily hiding other rows.

For example, a school has students in JSS 1, JSS 2, and JSS 3. If the teacher wants to see only JSS 2 students, the teacher can apply a filter.

How to Apply a Filter

  1. Click anywhere inside your data table.
  2. Open the Data tab.
  3. Click Filter.
  4. Small dropdown arrows will appear beside your column headings.
  5. Click the arrow beside the Class heading.
  6. Untick Select All.
  7. Select JSS 2.
  8. Click OK.

Excel will now show only students in JSS 2. Other students are hidden temporarily, not deleted.

Types of Filters

  • Text Filters: Find names or words that contain specific text.
  • Number Filters: Display numbers greater than, less than, or equal to a value.
  • Date Filters: Display records from a particular date or period.
  • Custom Filters: Combine conditions to find specific records.

Example: Finding Students Who Scored Above 70

  1. Click the dropdown arrow beside the Score heading.
  2. Select Number Filters.
  3. Choose Greater Than.
  4. Enter 70.
  5. Click OK.

Excel will display students whose scores are greater than 70.

4. What Is Data Validation?

Data Validation is an Excel feature that controls the type of information users can enter into a cell.

Imagine you are creating a form for students to select their class. You want students to choose only JSS 1, JSS 2, or JSS 3. You do not want someone entering Primary 5 or SS 4 by mistake.

Data Validation helps prevent these incorrect entries.

How to Create a Dropdown List

  1. Select the cells where users should choose their class.
  2. Open the Data tab.
  3. Click Data Validation.
  4. Under Allow, select List.
  5. In the Source box, enter: JSS 1,JSS 2,JSS 3.
  6. Click OK.

A dropdown arrow will appear when you select one of the validated cells. Users can now choose from the approved class names.

Other Data Validation Options

Option What It Does Example
Whole Number Allows only whole numbers within a selected range. Age between 10 and 18.
Decimal Allows decimal values. Weight between 20.5 and 80.5.
List Allows users to select from approved options. Male or Female, where appropriate for the form.
Date Restricts entries to a date range. Registration dates within a given year.
Text Length Controls the number of characters entered. A code must contain 6 characters.

5. Using Data Validation to Prevent Errors

Data Validation can help stop people from entering information that does not follow your rules.

Example: Restricting Examination Scores

Examination scores should be between 0 and 100. A score of 150 would be incorrect.

  1. Select the cells where examination scores will be entered.
  2. Go to Data and click Data Validation.
  3. Under Allow, choose Whole Number.
  4. Under Data, choose between.
  5. Enter 0 as the minimum.
  6. Enter 100 as the maximum.
  7. Click OK.

Excel will reject entries outside the permitted range if the validation error alert is enabled.

Adding an Error Message

You can tell users what they did wrong by creating an error message.

  1. Open Data Validation again.
  2. Select the Error Alert tab.
  3. Make sure Show error alert after invalid data is entered is enabled.
  4. Enter a title such as Invalid Score.
  5. Enter this message: Please enter a score between 0 and 100.
  6. Click OK.

6. Finding Invalid Data with Filters

Filters can help you identify unusual or incorrect information. For example, you can filter a score column to find values above 100 or use a text filter to find unexpected entries.

Here are some examples of data problems:

  • A student score of 150 instead of a score between 0 and 100.
  • A class name written as JSS-2 instead of JSS 2.
  • A registration date entered in the wrong format.
  • A phone number entered with missing digits.

Remember that filtering helps you locate suspicious records. You should check the original information before correcting it.

7. Practical Exercise: Clean a Student Records Table

You are helping a school in Lagos organise its student records. The school has provided the following information:

Name Class Score
AdeJSS 278
MaryJSS 195
ChukaJSS 365
FatimaJSS 288
SamuelJSS 1105
BisiJSS 372

Your Tasks

  1. Sort all students alphabetically from A to Z.
  2. Sort examination scores from highest to lowest.
  3. Apply a filter to display only JSS 2 students.
  4. Apply a number filter to display scores greater than 80.
  5. Create Data Validation to allow scores between 0 and 100.
  6. Identify the student record containing an invalid score.
Challenge: Correct the invalid score only after checking the original examination record. Do not guess what the student's actual score should be.

8. Module Summary

In this module, you have learned that:

  • Sorting arranges information in a particular order.
  • Ascending sorting arranges data from A to Z or smallest to largest.
  • Descending sorting arranges data from Z to A or largest to smallest.
  • Filtering displays only records that match selected conditions.
  • Data Validation controls the type of information entered into cells.
  • Error alerts can explain why an entry is not accepted.
  • Filters help locate suspicious or incorrect records.

Module Assessment

Answer the following questions to test your understanding.

Question 1

What does sorting mean in Excel?

  1. Deleting information
  2. Arranging information in a particular order
  3. Changing the colour of cells
  4. Creating a chart

Question 2

Which option arranges names from A to Z?

  1. Descending
  2. Filtering
  3. Ascending
  4. Deleting

Question 3

Which Excel feature displays only records that match your conditions?

  1. Filter
  2. Merge
  3. Wrap Text
  4. Print

Question 4

Which Excel feature can create a dropdown list of approved options?

  1. Conditional Formatting
  2. Data Validation
  3. Find and Replace
  4. Freeze Panes

Question 5

A teacher wants to prevent students from entering scores above 100. What should the teacher use?

  1. Data Validation
  2. Page Layout
  3. Spell Check
  4. Print Preview

Coming Up in Module 7

In the next module, you will learn advanced Excel data cleaning techniques. You will explore useful tools and functions that can help you clean larger datasets more efficiently.

Keep practising. The more data you clean, the better you become!

๐Ÿ† Get Certified

๐Ÿ”’

Earn this certificate

Every lesson is already free to read. Sign up, finish the lessons, pass the exam (โ‚ฆ2,000 or 20,000 coins), and get a verified certificate with your name on it.

๐ŸŽ“ Sign Up to Get Certified
๐Ÿ› ๏ธ Practice Tools
Hands-on simulators & labs - subscription required.
โ†’
๐ŸŽฏ Internship Tasks
Real-world tasks to build your portfolio - unlock them with a subscription.
โ†’