Hiring Partners
Segilola Resources Operating LimitedTaviatech TechnologiesFCMBMTN NigeriaAdvans La Fayette Microfinance BankAboki AfricaFirst Bank of NigeriaOPay
โ† Basic Data Transformation ยท Lesson 5 of 9

Module Four

๐Ÿ“– 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.
5
Module 4: Sorting, Filtering, and Organising Data

Module 4: Sorting, Filtering, and Organising Data

Welcome to Module 4!

Imagine that your teacher gives you a list containing the names and examination scores of 200 students.

Your teacher wants to know which student scored the highest, which students scored above 70, and how many students belong to JSS 2.

Will you read all 200 records one after another?

That could take a long time! Fortunately, you can use sorting, filtering, and data organisation to find the information quickly.

1. What Is Data Sorting?

Data sorting is the process of arranging information in a particular order.

You can sort information alphabetically, numerically, or according to dates.

Sorting makes it easier to find information and understand how different records compare.

Example: Sorting Student Names

Imagine that a school has the following list of students:

Before Sorting

Student Name
Samuel
David
Mary
Grace
Peter

After Sorting Alphabetically (A to Z)

Student Name
David
Grace
Mary
Peter
Samuel

Notice that the names are now arranged from A to Z.

2. Understanding Ascending and Descending Order

There are two common ways to sort information: ascending order and descending order.

A. Ascending Order

Ascending order means arranging information from the smallest to the largest, or from A to Z.

Examples:

  • Numbers: 5, 10, 15, 20, 25.
  • Names: David, Grace, Mary, Peter.
  • Scores: 40, 55, 70, 85, 95.

B. Descending Order

Descending order means arranging information from the largest to the smallest, or from Z to A.

Examples:

  • Numbers: 25, 20, 15, 10, 5.
  • Names: Peter, Mary, Grace, David.
  • Scores: 95, 85, 70, 55, 40.

Example: Examination Scores

Student Score
David85
Mary65
Samuel95
Grace75

Ascending Order:

65, 75, 85, 95

Descending Order:

95, 85, 75, 65

3. Sorting Dates and Times

Sorting is not only for names and numbers. You can also arrange dates and times.

For example, a school may have a list of examination dates. The school can arrange them from the earliest date to the latest.

Before Sorting

Subject Examination Date
English26 November 2026
Mathematics24 November 2026
Basic Science25 November 2026

After Sorting: Earliest to Latest

Subject Examination Date
Mathematics24 November 2026
Basic Science25 November 2026
English26 November 2026

4. What Is Data Filtering?

Data filtering is the process of displaying only the information that meets a particular condition.

Imagine that your school has 500 students, but you want to see only students in JSS 2.

Instead of reading all 500 records, you can apply a filter to display only JSS 2 students.

Example: School Student Records

Name Class Score
DavidJSS 285
MaryJSS 178
SamuelJSS 290
GraceJSS 365
PeterJSS 288

Filtering for JSS 2 gives us:

Name Class Score
DavidJSS 285
SamuelJSS 290
PeterJSS 288

Only the students in JSS 2 are displayed.

5. Understanding Filter Conditions

A filter condition is a rule that tells a computer which information should be displayed.

Here are some common examples:

Condition Meaning
Score greater than 70 Display scores above 70.
Score less than 50 Display scores below 50.
Class equals JSS 2 Display only JSS 2 students.
City equals Ibadan Display records for Ibadan.
Payment equals True Display records marked as paid.

Understanding Comparison Symbols

Symbol Meaning Example
> Greater than 80 > 70
< Less than 40 < 50
== Equal to in many programming languages 70 == 70
!= Not equal to 60 != 70
>= Greater than or equal to 70 >= 70
<= Less than or equal to 40 <= 50

6. Understanding Data Organisation

Data organisation means arranging information in a structured way so that it is easy to understand, access, and manage.

A well-organised dataset usually has clear headings, consistent formats, and properly arranged records.

Example: Organising Business Sales

Imagine a small shop in Ibadan that sells rice, beans, cooking oil, and milk.

Product Category Quantity Sold Price (โ‚ฆ)
RiceFood105,000
BeansFood83,000
Cooking OilFood54,500
MilkDrinks122,000

This table is organised because each column has a clear heading and each row contains information about one product.

7. Grouping Related Information

Grouping means putting similar records together based on a shared feature.

For example, a school can group students according to their classes.

Student Groups

JSS 1: Daniel, Peter, Esther.

JSS 2: David, Mary, Samuel.

JSS 3: Grace, John, Rebecca.

The students have been grouped according to their classes. This makes it easier for the school to manage each class.

8. Sorting and Filtering Using Excel and Google Sheets

Microsoft Excel and Google Sheets provide tools that make sorting and filtering easy.

How to Sort Information

  1. Open your spreadsheet.
  2. Select the table or a cell inside the dataset.
  3. Choose the Sort option from the toolbar or Data menu.
  4. Select the column you want to sort.
  5. Choose ascending or descending order.
  6. Apply the sorting operation.

How to Filter Information

  1. Open your spreadsheet.
  2. Select the table headings and data.
  3. Choose the Filter option from the Data menu.
  4. Click the filter arrow beside a column heading.
  5. Select the value or condition you want.
  6. View the matching records.
Important: When sorting a spreadsheet, make sure the complete dataset is included. Sorting only one column can separate names from their correct ages, scores, or other information.

9. Introduction to Sorting and Filtering with Python

Python is a programming language that can help us organise and transform data.

You do not need to become a programmer immediately. Let's look at a simple example.

Example: Sorting Examination Scores

scores = [85, 65, 90, 70, 95]

scores.sort()

print(scores)

Output:

[65, 70, 85, 90, 95]

The sort() instruction arranges the scores from the smallest to the largest.

Sorting from Highest to Lowest

scores = [85, 65, 90, 70, 95]

scores.sort(reverse=True)

print(scores)

Output:

[95, 90, 85, 70, 65]

The reverse=True option changes the order to descending.

Example: Filtering Scores Above 70

scores = [85, 65, 90, 70, 95]

high_scores = []

for score in scores:
    if score > 70:
        high_scores.append(score)

print(high_scores)

Output:

[85, 90, 95]

The program checks each score and keeps only scores greater than 70.

Remember: Sorting changes the order of information. Filtering selects which records to display. These are two different operations.

10. Practical Activity: Organise a School Dataset

Your Challenge!

A secondary school in Ibadan has collected examination results from five students.

Name Class Score City
SamuelJSS 285Ibadan
MaryJSS 165Oyo
DavidJSS 295Ibadan
GraceJSS 370Lagos
PeterJSS 275Oyo

Complete These Tasks

  1. Arrange the students alphabetically from A to Z.
  2. Arrange the examination scores from highest to lowest.
  3. Display only students in JSS 2.
  4. Display students who scored above 70.
  5. Display students who live in Ibadan.
  6. Group students according to their classes.

Use Microsoft Excel, Google Sheets, or a notebook to complete the activity.

11. Important Terms to Remember

Term Simple Meaning
Sorting Arranging information in a particular order.
Ascending Order Arranging from smallest to largest or A to Z.
Descending Order Arranging from largest to smallest or Z to A.
Filtering Displaying only information that meets a condition.
Filter Condition A rule used to select records.
Data Organisation Arranging information in a structured way.
Grouping Putting similar records together.

12. Module Summary

In this module, you learned how to arrange, select, and organise information.

  • Sorting arranges data in a particular order.
  • Ascending order moves from small to large or A to Z.
  • Descending order moves from large to small or Z to A.
  • Filtering displays only records that match a condition.
  • Grouping puts similar records together.
  • Excel, Google Sheets, and Python can help organise data.
Key Lesson: Sorting helps you arrange information, filtering helps you find specific information, and organisation makes your dataset easier to understand and manage.

13. Module 4 Assessment

Answer all ten questions. Select one correct option for each question.

1. What is data sorting?



2. What does ascending order mean?



3. What does descending order mean?



4. What is data filtering?



5. Which operation helps you find students in JSS 2 only?



6. Which of these is descending order?



7. What does grouping mean?



8. Which Python instruction sorts a list in ascending order?



9. What does the condition score > 70 mean?



10. Which tool can help sort and filter information?



๐Ÿ† 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.
โ†’