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 |
| Chinedu | JSS 2 | 75 |
| Amina | JSS 1 | 88 |
| David | JSS 3 | 65 |
| Bola | JSS 2 | 92 |
How to Sort Names from A to Z
- Open your Excel worksheet.
- Click any cell inside your student table.
- Go to the Data tab.
- Click Sort.
- Select Student Name under the Sort by option.
- Choose A to Z.
- 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.
- Click a cell in the Score column.
- Open the Data tab.
- Choose Sort Largest to Smallest.
- 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.
- Click a date in your table.
- Open the Data tab.
- Choose Sort Oldest to Newest.
- 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
- Click anywhere inside your data table.
- Open the Data tab.
- Click Filter.
- Small dropdown arrows will appear beside your column headings.
- Click the arrow beside the Class heading.
- Untick Select All.
- Select JSS 2.
- 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
- Click the dropdown arrow beside the Score heading.
- Select Number Filters.
- Choose Greater Than.
- Enter 70.
- 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
- Select the cells where users should choose their class.
- Open the Data tab.
- Click Data Validation.
- Under Allow, select List.
- In the Source box, enter:
JSS 1,JSS 2,JSS 3.
- 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.
- Select the cells where examination scores will be entered.
- Go to Data and click Data Validation.
- Under Allow, choose Whole Number.
- Under Data, choose between.
- Enter 0 as the minimum.
- Enter 100 as the maximum.
- 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.
- Open Data Validation again.
- Select the Error Alert tab.
- Make sure Show error alert after invalid data is entered is enabled.
- Enter a title such as Invalid Score.
- Enter this message: Please enter a score between 0 and 100.
- 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 |
| Ade | JSS 2 | 78 |
| Mary | JSS 1 | 95 |
| Chuka | JSS 3 | 65 |
| Fatima | JSS 2 | 88 |
| Samuel | JSS 1 | 105 |
| Bisi | JSS 3 | 72 |
Your Tasks
- Sort all students alphabetically from A to Z.
- Sort examination scores from highest to lowest.
- Apply a filter to display only JSS 2 students.
- Apply a number filter to display scores greater than 80.
- Create Data Validation to allow scores between 0 and 100.
- 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?
- Deleting information
- Arranging information in a particular order
- Changing the colour of cells
- Creating a chart
Question 2
Which option arranges names from A to Z?
- Descending
- Filtering
- Ascending
- Deleting
Question 3
Which Excel feature displays only records that match your conditions?
- Filter
- Merge
- Wrap Text
- Print
Question 4
Which Excel feature can create a dropdown list of approved options?
- Conditional Formatting
- Data Validation
- Find and Replace
- Freeze Panes
Question 5
A teacher wants to prevent students from entering scores above 100. What should the teacher use?
- Data Validation
- Page Layout
- Spell Check
- 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!