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

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 Grouping PivotTable Data Module 6: Sorting, Filtering and Grouping PivotTable Data

Module 6: Sorting, Filtering and Grouping PivotTable Data

Introduction

Imagine you own a supermarket in Ibadan. Every day, customers buy rice, beans, noodles, drinks, bread and other products.

At the end of the month, you want to answer questions such as:

  • Which product made the highest sales?
  • Which branch sold the least?
  • How much did we sell in January?
  • How many sales did each salesperson make?

Looking through hundreds or thousands of records manually can take a long time. Fortunately, Excel PivotTables have tools that make this work easier.

In this module, you will learn how to sort, filter and group information in a PivotTable so that you can find important information quickly.

1. What Is Sorting in a PivotTable?

Sorting means arranging information in a particular order.

For example, imagine your PivotTable shows the following sales:

Product Total Sales
Riceโ‚ฆ250,000
Beansโ‚ฆ120,000
Milkโ‚ฆ180,000
Noodlesโ‚ฆ90,000

You may want to arrange the products from the highest sales to the lowest sales.

After sorting, the report will look like this:

Product Total Sales
Riceโ‚ฆ250,000
Milkโ‚ฆ180,000
Beansโ‚ฆ120,000
Noodlesโ‚ฆ90,000

This makes it easier to identify the best-selling product.

2. Types of Sorting

Excel allows you to arrange PivotTable information in different ways.

A. Sort from A to Z

This arranges text alphabetically, starting with A and ending with Z.

Example:

  • Beans
  • Milk
  • Noodles
  • Rice

B. Sort from Z to A

This arranges text in reverse alphabetical order.

Example:

  • Rice
  • Noodles
  • Milk
  • Beans

C. Sort from Smallest to Largest

This arranges numbers from the lowest value to the highest value.

Example: 10, 25, 50, 100.

D. Sort from Largest to Smallest

This arranges numbers from the highest value to the lowest value.

Example: 100, 50, 25, 10.

Remember: Sorting changes the order in which information appears. It does not delete the original records or change the actual sales figures.

3. How to Sort a PivotTable

Follow these steps to sort products by total sales:

  1. Open your Excel workbook.
  2. Click anywhere inside your PivotTable.
  3. Find the product names in the Row Labels area or the corresponding field heading.
  4. Right-click one of the product names.
  5. Choose Sort.
  6. Select Sort Largest to Smallest or the descending option for the sales values.

You can also use the sort options in the PivotTable field's drop-down menu. In some Excel versions, you may need to select More Sort Options to choose sorting by a particular value field.

Important: If your PivotTable contains several value fields, check that you are sorting by the correct one, such as Sum of Sales rather than Count of Sales.

4. What Is Filtering in a PivotTable?

Filtering means displaying only the information you want to see while temporarily hiding other information.

For example, a supermarket may have branches in Ibadan, Lagos and Abuja.

You may want to see sales from the Ibadan branch only. Instead of deleting the other branches, you can use a filter.

Filtering helps you focus on specific information without removing the original data.

5. Types of PivotTable Filters

A. Report Filter

A Report Filter allows you to display information for a selected category.

For example, if you place the Branch field in the Filters area, you can select Ibadan, Lagos or Abuja.

B. Label Filter

A Label Filter allows you to filter information based on text labels.

For example, you can display only products whose names begin with the letter R.

C. Value Filter

A Value Filter allows you to display records based on their numerical values.

For example, you can display only products with total sales greater than โ‚ฆ100,000.

D. Date Filter

A Date Filter allows you to focus on records from particular dates or periods.

For example, you can display sales made between January and March.

6. How to Apply a Report Filter

Let's assume your PivotTable contains sales information for three branches:

Branch Product Total Sales
IbadanRiceโ‚ฆ150,000
LagosRiceโ‚ฆ200,000
AbujaRiceโ‚ฆ180,000
IbadanBeansโ‚ฆ90,000
LagosBeansโ‚ฆ110,000

Follow these steps:

  1. Click anywhere inside the PivotTable.
  2. Find the PivotTable Fields panel.
  3. Drag the Branch field into the Filters area.
  4. Look above your PivotTable for the Branch filter.
  5. Click the drop-down arrow.
  6. Select Ibadan.
  7. Click OK or Apply, depending on your Excel version.

Your PivotTable will now show information for the Ibadan branch only.

Tip: Select All in the filter menu when you want to display every branch again.

7. How to Use Value Filters

Imagine you want to identify products that generated more than โ‚ฆ100,000 in sales.

Follow these steps:

  1. Click the drop-down arrow beside the Row Labels or product field.
  2. Choose Value Filters.
  3. Select Greater Than.
  4. Choose the sales value field, such as Sum of Sales.
  5. Enter 100000.
  6. Click OK.

Excel will display products whose total sales are greater than โ‚ฆ100,000.

You can also use other value filter options, such as:

  • Less Than
  • Greater Than or Equal To
  • Less Than or Equal To
  • Between
  • Top 10

8. What Is Grouping in a PivotTable?

Grouping means combining related information into larger categories.

For example, a business may record sales every day. Instead of studying every date separately, you can group the dates into months, quarters or years.

Grouping makes large reports easier to understand.

Example: Grouping Dates into Months

Imagine you have the following sales records:

Date Sales
05/01/2026โ‚ฆ20,000
12/01/2026โ‚ฆ35,000
08/02/2026โ‚ฆ40,000
15/02/2026โ‚ฆ25,000
10/03/2026โ‚ฆ50,000

Instead of displaying every date, you can group the records by month.

Your summary may look like this:

Month Total Sales
Januaryโ‚ฆ55,000
Februaryโ‚ฆ65,000
Marchโ‚ฆ50,000

9. How to Group Dates by Month

Follow these steps:

  1. Create a PivotTable using your sales dataset.
  2. Drag the Date field into the Rows area.
  3. Drag the Sales field into the Values area.
  4. Right-click any date displayed in the PivotTable.
  5. Select Group.
  6. Choose Months.
  7. You may also select Years if your dataset covers more than one year.
  8. Click OK.

Your daily sales records will now be grouped into months.

Important: If the Group option is unavailable, check that your source date column contains real Excel dates. Text that only looks like a date may not group correctly. Also check for blank or invalid date values.

10. Grouping Numbers

You can also group numerical information into ranges.

For example, imagine a school wants to group students according to their examination scores.

Student Score
Ada45
Tunde58
Mary67
John75
David89

You can group these scores into ranges such as:

  • 0โ€“49
  • 50โ€“59
  • 60โ€“69
  • 70โ€“79
  • 80โ€“89

To do this:

  1. Place the Score field in the Rows area.
  2. Right-click one of the score values in the PivotTable.
  3. Select Group.
  4. Enter the starting and ending values.
  5. Enter the interval size in the By box.
  6. Click OK.

For example, entering 10 in the By box creates groups with intervals of 10, where the selected starting and ending values allow it.

11. Why Sorting, Filtering and Grouping Are Important

These three features help people understand information more quickly.

Feature What It Does Example
Sorting Arranges information in an order. Highest sales to lowest sales.
Filtering Displays selected information. Showing Ibadan branch sales only.
Grouping Combines related information. Grouping daily sales by month.

12. Practical Activity

Project: Analyse Supermarket Sales

Open the supermarket sales workbook you created in the previous modules.

Complete the following activities:

  1. Create a PivotTable showing total sales by product.
  2. Sort the products from highest sales to lowest sales.
  3. Add the Branch field to the Filters area.
  4. Filter the report to show Ibadan sales only.
  5. Change the filter to show Lagos sales only.
  6. Create another PivotTable showing sales by date.
  7. Group the dates by month.
  8. Identify the month with the highest sales.

Challenge: Find the five products with the highest total sales. Use the Top 10 Value Filter and adjust it to show the top five.

Save your workbook as Supermarket Sales Analysis Module 6.xlsx.

13. Common Mistakes to Avoid

  • Sorting the wrong field: Always confirm whether you are sorting by product name, sales amount or another value.
  • Using the wrong filter: A Label Filter checks text labels, while a Value Filter checks numerical results.
  • Grouping invalid dates: Make sure your date column contains valid Excel dates.
  • Forgetting to clear filters: A PivotTable may continue showing only selected records until you clear the filter.
  • Thinking filtered records are deleted: Filtering only hides information from the current report. It does not delete the source records.

14. Important Terms to Remember

Term Meaning
SortingArranging information in a particular order.
FilteringDisplaying only selected information.
GroupingCombining related information into categories.
Report FilterA filter placed in the Filters area of a PivotTable.
Label FilterA filter based on text labels.
Value FilterA filter based on numerical values.
Date FilterA filter used to select dates or date periods.
Top 10 FilterA filter that displays a selected number of top or bottom items.

15. Module Assessment: Test Your Knowledge

Answer the following questions to check what you have learned.

Question 1

What does sorting mean in a PivotTable?

  1. Deleting records
  2. Arranging information in a particular order
  3. Changing the workbook password
  4. Closing Excel

Question 2

Which sorting option arranges numbers from the highest to the lowest?

  1. Sort A to Z
  2. Sort Oldest to Newest
  3. Sort Largest to Smallest
  4. Sort Smallest to Largest

Question 3

What is the main purpose of filtering?

  1. To display selected information
  2. To delete the source dataset
  3. To create a new workbook
  4. To change the font size

Question 4

Which PivotTable area is used for a Report Filter?

  1. Rows
  2. Columns
  3. Values
  4. Filters

Question 5

Which filter would you use to show products with sales greater than โ‚ฆ100,000?

  1. Label Filter
  2. Value Filter
  3. Colour Filter
  4. Font Filter

Question 6

What does grouping do in a PivotTable?

  1. Deletes information
  2. Changes the workbook name
  3. Combines related information into categories
  4. Removes all calculations

Question 7

Which option can be used to group daily sales records?

  1. Months
  2. Font size
  3. Page colour
  4. Text alignment

Question 8

What should you check if Excel cannot group dates?

  1. Whether the workbook has a title
  2. Whether the date column contains valid Excel dates
  3. Whether the font is blue
  4. Whether the computer has speakers

Question 9

Which filter can help you display the five products with the highest sales?

  1. Date Filter
  2. Label Filter
  3. Top 10 Value Filter
  4. Font Filter

Question 10

Does filtering a PivotTable delete the hidden records from the original dataset?

  1. Yes, always
  2. Only on Mondays
  3. Yes, if the filter is saved
  4. No, it only changes what is displayed in the report

16. Assessment Answer Key

Question Correct Answer
1B โ€“ Arranging information in a particular order
2C โ€“ Sort Largest to Smallest
3A โ€“ To display selected information
4D โ€“ Filters
5B โ€“ Value Filter
6C โ€“ Combines related information into categories
7A โ€“ Months
8B โ€“ Whether the date column contains valid Excel dates
9C โ€“ Top 10 Value Filter
10D โ€“ No, it only changes what is displayed in the report

17. Module Summary

Well done! You have completed Module 6 of Pivot Tables in Excel.

In this module, you learned how to:

  • Sort PivotTable information alphabetically and numerically.
  • Arrange sales figures from highest to lowest.
  • Apply Report Filters to display selected branches.
  • Use Label Filters and Value Filters.
  • Group dates into months and years.
  • Group numerical values into ranges.
  • Use sorting, filtering and grouping to analyse business information.
Next Module: Module 7 โ€“ Formatting and Customising PivotTables.

In the next module, you will learn how to make your PivotTable reports attractive, organised and easier to read using styles, number formats, layouts and other formatting tools.

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