Data Analysis /Microsoft Excel for Data Analysis / Lesson
Data Analysis

Pivot Tables

Learn how to summarize, group, filter and analyze large Excel datasets using Pivot Tables, Slicers and Pivot Charts.

🎯

Learning Objectives

Explain what a Pivot Table is.
Create Pivot Tables from structured datasets.
Use Rows, Columns, Values and Filters.
Summarize data using Sum, Count and Average.
Group dates and numerical values.
Use Slicers for interactive filtering.
Refresh Pivot Tables when source data changes.
Create Pivot Charts.
Use Pivot Tables in dashboards.
Validate Pivot Table results before making decisions.

📖

Lesson Content

Pivot Tables in Microsoft Excel

Pivot Tables are one of the most powerful tools in Microsoft Excel for
data analysis. They allow an analyst to summarize, organize and explore
large datasets without manually writing many formulas.

Instead of examining hundreds or thousands of individual records,
a Pivot Table can quickly answer questions such as:

  • How many students are enrolled in each course?
  • What is the total sales amount by product?
  • What is the average score by course?
  • Which month generated the highest revenue?
  • How many transactions occurred in each region?

1. Learning Objectives

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

  • Explain what a Pivot Table is.
  • Understand the structure of Pivot Tables.
  • Create a Pivot Table from a dataset.
  • Understand Rows, Columns, Values and Filters.
  • Summarize numerical data.
  • Count records using Pivot Tables.
  • Calculate averages and other statistics.
  • Group dates and numerical values.
  • Filter Pivot Table results.
  • Use slicers with Pivot Tables.
  • Refresh Pivot Tables.
  • Build useful analytical summaries.

2. What Is a Pivot Table?

A Pivot Table is an Excel analytical tool that summarizes data by
grouping records according to selected fields.

The word “pivot” refers to the ability to rearrange or pivot the
perspective of a dataset.

For example, a sales dataset can be summarized by:

  • Product.
  • Customer.
  • Region.
  • Salesperson.
  • Month.
  • Year.

3. Why Pivot Tables Matter

Raw data often contains many individual records. Looking at every
record manually makes analysis difficult.

Pivot Tables transform detailed records into meaningful summaries.

They are useful for:

  • Trend analysis.
  • Performance analysis.
  • Sales reporting.
  • Student performance analysis.
  • Financial analysis.
  • Inventory analysis.
  • Marketing analysis.
  • Operational reporting.

4. Example Dataset

Imagine the following sales dataset:

DateProductRegionSalespersonQuantitySales
01/10/2026LaptopSouthJohn21000000
02/10/2026MouseWestMary10120000
03/10/2026KeyboardSouthDavid5125000

A Pivot Table can summarize this dataset by region, product or
salesperson.


5. Creating a Pivot Table

To create a Pivot Table:

  1. Make sure the dataset has proper headers.
  2. Select a cell inside the dataset.
  3. Go to Insert → PivotTable.
  4. Confirm the data source.
  5. Choose where to place the Pivot Table.
  6. Click OK.

Excel will create a blank Pivot Table layout where you can arrange
fields.


6. Pivot Table Fields

The PivotTable Fields pane usually contains four major areas:

  • Filters
  • Columns
  • Rows
  • Values

Understanding these four areas is fundamental to using Pivot Tables.


7. Rows Area

The Rows area determines how records are grouped vertically.

For example, placing Product in Rows can produce:

Laptop
Keyboard
Mouse
Monitor

Each product becomes a category in the Pivot Table.


8. Columns Area

The Columns area determines how information is displayed horizontally.

For example, placing Region in Columns may produce:

South | West | North | East

This allows you to compare categories side by side.


9. Values Area

The Values area contains the calculations performed on the dataset.

Common calculations include:

  • Sum.
  • Count.
  • Average.
  • Maximum.
  • Minimum.
  • Product.

10. Filters Area

The Filters area allows the entire Pivot Table to be filtered based on
a selected field.

For example, you could place Region in Filters and select only South.


11. Simple Sales Pivot Table

Suppose you want to know total sales by product.

Configure the Pivot Table as follows:

Rows:
Product

Values:
Sales → Sum

The result might look like:

Product       Total Sales
Laptop        ₦5,000,000
Keyboard      ₦1,250,000
Mouse         ₦900,000
Monitor       ₦2,100,000

12. Counting Records

A Pivot Table can count records instead of adding values.

For example, to count the number of students in each course:

Rows:
Course

Values:
Student ID → Count

This produces the number of students in each course.


13. Average Values

Pivot Tables can calculate averages.

For example, to find the average score per course:

Rows:
Course

Values:
Score → Average

This is useful for educational performance analysis.


14. Maximum and Minimum

You can also identify the highest and lowest values.

For example:

Rows:
Course

Values:
Score → Max

This can show the highest score achieved in each course.


15. Multiple Fields in Rows

More than one field can be placed in the Rows area.

For example:

Rows:
Region
Product

Values:
Sales → Sum

This allows sales to be analyzed by region and then by product.


16. Multiple Fields in Values

Multiple calculations can also be added to Values.

For example:

Values:
Sales → Sum
Sales → Average
Sales → Max

This can provide several perspectives on the same dataset.


17. Sorting Pivot Table Results

Pivot Table results can be sorted.

For example, you can sort products from highest sales to lowest sales.

This helps identify top-performing products quickly.


18. Filtering Pivot Tables

Pivot Tables provide several ways to filter information.

Examples include:

  • Field filters.
  • Label filters.
  • Value filters.
  • Report filters.
  • Slicers.

19. Value Filters

Value Filters allow you to filter based on calculated values.

For example:

Show products where
Sum of Sales > ₦500,000

This is useful for identifying high-performing categories.


20. Top 10 Analysis

Pivot Tables can be used to identify top-performing records.

For example:

  • Top 10 products by revenue.
  • Top 10 customers by sales.
  • Top 10 students by score.

The Top 10 filter is useful for ranking and prioritization.


21. Grouping Dates

Date fields can often be grouped into meaningful periods.

For example:

  • Years.
  • Quarters.
  • Months.
  • Days.

This allows an analyst to transform individual transaction dates into
time-based summaries.


22. Monthly Sales Analysis

Suppose the dataset contains thousands of transactions.

A Pivot Table can summarize:

Rows:
Date → Group by Months

Values:
Sales → Sum

The resulting summary can show monthly revenue trends.


23. Grouping Numbers

Numerical values can also be grouped into ranges.

For example, student scores could be grouped as:

0–49
50–59
60–69
70–79
80–89
90–100

This can make score distribution easier to understand.


24. Slicers

A Slicer provides a visual way to filter a Pivot Table.

Instead of opening a dropdown menu, the user can click buttons
representing filter values.

Slicers are especially useful when creating interactive dashboards.


25. Example of a Slicer

For a sales report, you could create slicers for:

  • Region.
  • Product.
  • Salesperson.
  • Category.

Selecting a slicer value updates the connected Pivot Table.


26. Refreshing a Pivot Table

Pivot Tables do not always update automatically when the underlying
data changes.

You can refresh a Pivot Table by:

  1. Right-clicking the Pivot Table.
  2. Selecting Refresh.

You can also use Excel’s refresh options from the PivotTable tools.


27. Why Refreshing Matters

If new records are added to the source data, the Pivot Table may not
show them until the data source is updated and the Pivot Table is
refreshed.

Always confirm that your report contains the latest available data.


28. Pivot Tables and Excel Tables

Pivot Tables work particularly well with Excel Tables.

If the source dataset is an Excel Table, new records can become part of
the structured source as the Table expands.

After adding new records, refresh the Pivot Table.


29. Pivot Tables and Data Quality

Pivot Tables summarize whatever data they receive. They do not
automatically determine whether the underlying data is correct.

Before creating a Pivot Table, check:

  • Missing values.
  • Duplicate records.
  • Incorrect dates.
  • Inconsistent category names.
  • Incorrect numbers.
  • Blank headers.

30. Example of a Data Quality Problem

Imagine the same course appears as:

Data Analysis
Data analysis
Data Analysis 
Data  Analysis

Excel may treat these as different text values depending on the exact
underlying characters.

This can produce misleading Pivot Table results.

Data should therefore be standardized before analysis.


31. Pivot Tables for Student Analysis

A training organization can use Pivot Tables to analyze student data.

Example fields:

  • Student ID
  • Student Name
  • Course
  • Gender
  • Registration Date
  • Score
  • Status

You could create a Pivot Table showing the number of students per
course.

Rows:
Course

Values:
Student ID → Count

32. Student Performance Analysis

To analyze average student scores:

Rows:
Course

Values:
Score → Average

This allows management to compare performance between courses.


33. Enrollment Trend Analysis

To analyze enrollment over time:

Rows:
Registration Date → Group by Month

Values:
Student ID → Count

This can reveal periods of high and low enrollment.


34. Sales Analysis

A business can use Pivot Tables to analyze sales by:

  • Product.
  • Category.
  • Region.
  • Customer.
  • Salesperson.
  • Month.

This makes it easier to discover profitable products and weak
performing areas.


35. Profit Analysis

If a dataset contains Revenue and Cost, a Profit field can be created.

Profit = Revenue - Cost

A Pivot Table can then summarize profit by product, region or month.


36. Pivot Tables and Business Questions

A good analyst should not create Pivot Tables simply because the tool
is available.

Start with a business question.

Examples:

  • Which product generates the most revenue?
  • Which region has the highest sales?
  • Which course has the highest average student score?
  • How has enrollment changed over time?

Then design the Pivot Table to answer the question.


37. Pivot Table Calculations

Pivot Tables can summarize data using different aggregation methods.

Common methods include:

  • Sum.
  • Count.
  • Average.
  • Maximum.
  • Minimum.
  • Product.
  • Standard deviation in supported configurations.

38. Show Values As

Pivot Tables can display values in alternative ways.

Examples include:

  • Percentage of Grand Total.
  • Percentage of Row Total.
  • Percentage of Column Total.
  • Difference From.
  • Running Total.
  • Rank.

This provides more analytical insight than simple totals.


39. Percentage of Grand Total

For example, if a company wants to know each product’s contribution to
total sales, the Pivot Table can display sales as a percentage of the
Grand Total.

This helps identify the relative importance of each category.


40. Running Totals

A running total accumulates values over time.

For monthly sales, a running total can show how revenue accumulates
throughout the year.


41. Pivot Charts

A Pivot Chart is a chart connected to a Pivot Table.

Pivot Charts make summarized data easier to understand visually.

Common chart types include:

  • Column charts.
  • Bar charts.
  • Line charts.
  • Pie charts.
  • Area charts.

42. Pivot Tables and Dashboards

Pivot Tables often serve as the analytical engine behind Excel
dashboards.

A dashboard can contain:

  • Pivot Tables.
  • Pivot Charts.
  • Slicers.
  • KPIs.
  • Summary cards.
  • Trend charts.

43. Common Pivot Table Mistakes

  • Using a poorly structured source dataset.
  • Leaving blank headers.
  • Using inconsistent categories.
  • Forgetting to refresh the Pivot Table.
  • Using the wrong aggregation method.
  • Interpreting counts as totals.
  • Ignoring duplicate records.
  • Creating a Pivot Table without a clear question.
  • Using too many fields at once.
  • Failing to validate the results.

44. Validate Pivot Table Results

An analyst should verify that Pivot Table results make sense.

For example, if total sales in the Pivot Table are ₦20 million but the
source report indicates ₦12 million, investigate the difference.

Possible causes include:

  • Incorrect source range.
  • Duplicate records.
  • Incorrect filters.
  • Missing data.
  • Incorrect calculations.
  • Old Pivot Table data.

45. Pivot Table Workflow

  1. Define the analytical question.
  2. Inspect the dataset.
  3. Clean the data.
  4. Convert the dataset to an Excel Table where appropriate.
  5. Create the Pivot Table.
  6. Choose Rows.
  7. Choose Columns if needed.
  8. Choose Values.
  9. Add Filters if necessary.
  10. Apply sorting or filtering.
  11. Refresh and validate.
  12. Interpret the results.
  13. Present the findings.

46. Practical Exercise

Create a dataset containing at least 30 sales transactions.

Use these fields:

  • Date
  • Product
  • Category
  • Region
  • Salesperson
  • Quantity
  • Sales

Then complete the following:

  1. Convert the dataset into an Excel Table.
  2. Create a Pivot Table showing sales by product.
  3. Create a Pivot Table showing sales by region.
  4. Calculate average sales by salesperson.
  5. Count transactions by category.
  6. Group sales by month.
  7. Identify the top five products by sales.
  8. Create a slicer for Region.
  9. Create a Pivot Chart showing monthly sales.
  10. Refresh the Pivot Table after adding new records.

47. Knowledge Check

  1. What is a Pivot Table?
  2. Why are Pivot Tables useful for data analysis?
  3. What is the purpose of the Rows area?
  4. What is the purpose of the Columns area?
  5. What is the purpose of the Values area?
  6. What is the purpose of the Filters area?
  7. How can you calculate average scores using a Pivot Table?
  8. Why is refreshing a Pivot Table important?
  9. What is a Slicer?
  10. How can Pivot Tables support dashboards?
  11. Why should the source dataset be cleaned before analysis?
  12. What is a Pivot Chart?

48. Key Terms

  • Pivot Table: An Excel tool for summarizing and analyzing data.
  • Rows: The Pivot Table area used to group data vertically.
  • Columns: The area used to group information horizontally.
  • Values: The area containing calculations.
  • Filters: Controls used to limit displayed information.
  • Slicer: A visual filtering control.
  • Pivot Chart: A chart connected to a Pivot Table.
  • Refresh: The process of updating a Pivot Table from its source.
  • Aggregation: Combining records using calculations such as Sum, Count or Average.

49. Key Takeaways

  • Pivot Tables summarize large datasets quickly.
  • Rows determine how data is grouped vertically.
  • Columns provide horizontal grouping.
  • Values contain calculations.
  • Filters restrict the displayed data.
  • Slicers provide interactive filtering.
  • Dates can be grouped into months, quarters and years.
  • Pivot Tables can calculate sums, counts, averages and other statistics.
  • Pivot Charts help visualize summarized data.
  • Always validate Pivot Table results.
  • Refresh Pivot Tables when the source data changes.

50. Summary

Pivot Tables are an essential Excel data analysis tool. They allow
analysts to transform large collections of records into meaningful
summaries.

By placing fields into Rows, Columns, Values and Filters, an analyst
can quickly investigate patterns, compare categories and calculate
important metrics.

Pivot Tables become even more powerful when combined with Excel Tables,
Slicers, Pivot Charts and dashboards.

However, Pivot Tables are only as reliable as the data behind them.
Cleaning, validating and understanding the source data remains an
important part of the analytical process.


Next Lesson

In the next lesson, we will learn about
Charts and how to transform Excel data into clear
visual representations that communicate trends, comparisons and
insights effectively.

💻

Code Example

/*
Dwallnet Data Analysis
Module 2 — Lesson 11
Pivot Tables

Pivot Table configuration examples:

1. Total sales by product

Rows:
Product

Values:
Sales → Sum


2. Number of students by course

Rows:
Course

Values:
Student ID → Count


3. Average score by course

Rows:
Course

Values:
Score → Average


4. Sales by region and product

Rows:
Region
Product

Values:
Sales → Sum


5. Monthly enrollment

Rows:
Registration Date → Group by Month

Values:
Student ID → Count


6. Useful supporting formulas:

Total:
=SUM(SalesData[Sales])

Average:
=AVERAGE(Students[Score])

Count:
=COUNT(Students[Student ID])

Conditional count:
=COUNTIF(Students[Course],"Data Analysis")
⭐

Key Takeaways

Pivot Tables summarize large datasets quickly.
Rows determine vertical grouping.
Columns provide horizontal grouping.
Values contain calculations.
Filters restrict displayed information.
Slicers provide interactive filtering.
Dates can be grouped into months, quarters and years.
Pivot Tables support dashboards and Pivot Charts.
Always refresh and validate Pivot Table results.

Enjoying this lesson?

Sign in to your Dwallnet Academy student account to track your learning progress and mark lessons as complete.

Sign In to Track Progress