Microsoft Excel 2024 Comprehensive Course — Beginner to Intermediate
X
Excel 2024 Microsoft 365
📗 34 Modules Foundations Data Entry Formatting Formulas Functions Charts Pivot Tables Data Analysis Protection Automation

📊 Module 25: Pivot Tables & Pivot Charts

A Pivot Table is the single most powerful analytical tool in Excel. With a few mouse clicks, it can transform thousands of rows of raw data into a concise, interactive summary — totals by region, averages by department, counts by category, with instant drill-down and the ability to switch perspectives in seconds. Where a formula-based report takes hours to build and is difficult to modify, a Pivot Table takes minutes and can be completely restructured by dragging and dropping fields. This module covers creating, formatting, customising, and interrogating Pivot Tables, as well as the Pivot Chart that brings them to life visually.

25.1 What Is a Pivot Table?

A Pivot Table is a dynamic summary table that groups, aggregates, and reorganises data from a source dataset. It "pivots" your data — the same underlying figures can be summarised in completely different ways depending on which fields you place in which areas.

The Four Pivot Table Areas

┌──────────────────────────────────────────┐
│ FILTERS  (one filter per field — at the top, above the table)  │
├──────────────────────────────────────────┤
│                       | Q1    Q2    Q3    Q4    │
│ ROWS →             |                             │
│ Gauteng              | VALUES are summarised       │
│ Western Cape         | at each row/column         │
│ KwaZulu-Natal        | intersection              │
│                        |                             │
│                       COLUMNS ▼                 │
└──────────────────────────────────────────┘
AreaWhat It DoesExample Fields
Rows Each unique value in this field becomes a row label on the left side of the Pivot Table Region, Department, Salesperson, Product, Month
Columns Each unique value becomes a column header across the top Quarter, Year, Status, Product Category
Values The numeric field to summarise (Sum, Count, Average, Max, Min, etc.) — displayed at each row/column intersection Revenue, Salary, Quantity, Units Sold, Hours
Filters A dropdown filter at the top of the entire Pivot Table — filters the entire table to show only selected values Year, Country, Business Unit, Product Line

25.2 Creating a Pivot Table

Source Data Requirements

  • Data must be in a flat table format: one header row, one record per row, no blank rows or blank columns within the data
  • Column headers must be unique — no two columns can share the same name
  • Each column should contain one data type only (all text, all numbers, or all dates)
  • Ideally, convert the source to an Excel Table (Ctrl+T) first — a Table source automatically expands when new rows are added, so the Pivot Table includes new data after refresh

Inserting a Pivot Table

  1. Click anywhere inside the source data (or inside an Excel Table)
  2. Insert tab → Tables group → PivotTable
  3. The Create PivotTable dialog opens:
    • Select a table or range: the range is auto-detected. If using a Table, the Table name appears (e.g., SalesData).
    • Use an external data source: for connecting to databases, Power Query, etc.
    • New Worksheet (recommended): the Pivot Table is placed on a new, dedicated sheet
    • Existing Worksheet: choose a location on an existing sheet
  4. Click OK
  5. A blank Pivot Table placeholder appears on the left; the PivotTable Fields pane opens on the right showing all column headers from the source data as available fields

Building the Pivot Table — Dragging Fields

  1. In the Fields pane (right side), all source columns appear as fields with checkboxes
  2. Drag fields from the top section to the four areas at the bottom of the pane:
    • Rows area: drag "Region" → each region appears as a row
    • Columns area: drag "Quarter" → each quarter becomes a column
    • Values area: drag "Revenue" → the sum of revenue appears at each intersection
    • Filters area: drag "Year" → a year dropdown appears above the table
  3. Alternatively: tick a field's checkbox → Excel automatically places it in the most appropriate area (text fields go to Rows, numeric fields go to Values)
  4. Drag fields between areas to restructure the report instantly
  5. Remove a field: drag it out of the area box — or — untick its checkbox

25.3 The PivotTable Analyse Tab

When any cell inside a Pivot Table is selected, the PivotTable Analyse contextual tab appears alongside the Design tab. PivotTable Analyse controls the data, layout, and tools of the Pivot Table.

GroupKey ToolsWhat They Do
PivotTable PivotTable Name, Options Name the Pivot Table for reference; access all PivotTable Options settings (layout, formatting, totals)
Active Field Field Settings, Expand/Collapse Open Field Settings for the selected field (change aggregation, number format, name); expand/collapse row groupings
Group Group Selection, Ungroup, Group Field Group dates into months/quarters/years; group numbers into ranges (bins); group selected items into a custom group
Filter Insert Slicer, Insert Timeline, Filter Connections Add Slicers and Timelines for visual filtering; connect filters to multiple Pivot Tables
Data Refresh, Change Data Source, Clear Refresh (updates the Pivot Table after source data changes); Change Data Source (point the Pivot Table to a different range/table); Clear (remove all fields or all filters)
Actions Clear, Select, Move PivotTable Clear filters or entire table; select only values or labels; move the Pivot Table to a different location
Calculations Fields, Items & Sets; Calculated Field; Calculated Item; Solve Order Add calculated fields (formulas using other field values); add calculated items; manage calculation order
Tools PivotChart, Recommended PivotTables Create a linked PivotChart; get AI-suggested Pivot Table layouts
Show Field List, +/- Buttons, Field Headers Show/hide the Field pane; show/hide expand/collapse +/- buttons; show/hide the Rows/Columns headers row

Refreshing the Pivot Table

Pivot Tables do not auto-refresh. When source data changes, the Pivot Table must be manually refreshed to reflect the new data. To refresh: right-click anywhere inside the Pivot Table → Refresh — or — PivotTable Analyse → Data → Refresh — or press Alt+F5. To refresh all Pivot Tables in the workbook: PivotTable Analyse → Data → Refresh All — or press Ctrl+Alt+F5.

25.4 Value Field Settings — Summarising Your Data

By default, numeric fields dragged to the Values area are summarised by Sum. Text fields are summarised by Count. You can change the aggregation function and control how the values are displayed.

Changing the Aggregation Function

  1. Click any value cell inside the Pivot Table — or — click the field in the Values area of the Fields pane
  2. PivotTable Analyse → Active Field → Field Settings — or — right-click the value cell → Value Field Settings…
  3. The Value Field Settings dialog opens on the "Summarise Values By" tab
FunctionWhat It CalculatesSA Use Case
SumTotal of all valuesTotal revenue, total salary, total units sold
CountNumber of non-blank entries (including text)Count of invoices, count of employees per department
AverageMean of all valuesAverage salary, average order value, average score
MaxLargest value in the groupHighest invoice per region, maximum salary per band
MinSmallest value in the groupLowest stock level per product, minimum order value
ProductMultiplied product of all valuesRarely used; compound growth calculations
Count NumbersCount of cells containing numbers only (ignores text)Count numeric entries vs all entries for completeness check
StdDev / StdDevpStandard deviation (sample / population)Salary dispersion analysis, quality control
Var / VarpVariance (sample / population)Statistical analysis of performance data

"Show Values As" — Displaying Calculations Instead of Raw Values

The "Show Values As" tab in Value Field Settings allows you to display each value as a calculation relative to others — without adding any formula columns to your source data.

Show Values As OptionDisplaysUse Case
% of Grand TotalEach value as a % of the overall grand totalEach region's share of total company revenue
% of Column TotalEach value as a % of its column subtotalEach product's share within each quarter
% of Row TotalEach value as a % of its row subtotalEach quarter's share of the region's annual total
Running Total InCumulative total within a field (e.g., Jan, Jan+Feb, Jan+Feb+Mar)Year-to-date revenue cumulation
% Running Total InCumulative % through the seriesPareto analysis — top products by cumulative %
Rank Smallest to LargestRank (1 = smallest)Rank regions by revenue
Rank Largest to SmallestRank (1 = largest)Leaderboard ranking of salesperson performance
Difference FromDifference between current value and a reference (e.g., previous month)Month-on-month change in sales
% Difference From% change from a reference valueMonth-on-month % growth rate

Number Format for Values

  • In Value Field Settings → click Number Format…
  • This opens the standard Format Cells Number dialog — apply any number format (Rand currency, percentage, thousands separator, date, etc.)
  • This applies the format to all values in that field in the Pivot Table without affecting the source data

25.5 Pivot Table Layout & Design

The Design contextual tab controls the visual appearance, layout, and subtotal/grand total settings of the Pivot Table.

Report Layout Options

LayoutAppearanceBest For
Compact Form (default) All row fields are in one column, indented. Labels are compact. Row field names do not show as headers. General use; saves horizontal space; good for drilling down into hierarchies
Outline Form Each row field is in its own column. Shows field names as column headers. Subtotals appear above each group. When you need to see which field is in which column; when copying to another spreadsheet
Tabular Form Each row field in its own column. Subtotals appear below each group. The closest layout to a flat table. Easiest to read and use as a data source. When you want to copy and use the Pivot Table data elsewhere; for reports that must look like a standard table

Subtotals and Grand Totals

SettingOptions
SubtotalsDo Not Show Subtotals / Show all Subtotals at Top / Show all Subtotals at Bottom
Grand TotalsOff for Rows and Columns / On for Rows and Columns / On for Rows Only / On for Columns Only

PivotTable Styles

  • Design tab → PivotTable Styles group — a gallery of pre-built visual styles (Light, Medium, Dark)
  • Hover to preview → click to apply
  • PivotTable Style Options: Banded Rows, Banded Columns, Row Headers (bold), Column Headers (bold) — tick/untick to customise
  • Create a custom style: Design → PivotTable Styles → New PivotTable Style…

25.6 Grouping — Dates and Numbers

Grouping automatically consolidates individual values into summary groups. This is one of the most powerful Pivot Table features — it allows you to summarise daily data by month, weekly data by quarter, or continuous numbers into bands.

Grouping Dates

  1. Add a date field to the Rows (or Columns) area
  2. In Excel 2016+, dates are automatically grouped by year/quarter/month. To change the grouping: right-click any date in the Pivot Table → Group…
  3. Select the grouping levels: Days, Months, Quarters, Years (select multiple for hierarchical grouping)
  4. Click OK
Source data has daily transaction dates → group by Months + Years
→ The Pivot Table shows Year rows with Month sub-rows
→ Clicking + next to a year expands to show monthly breakdown

SA Financial Year grouping: group by Months with
Starting at: 01/03/2024 (March) → Ending at: 28/02/2025 (February)

Grouping Numbers into Ranges (Bins)

  1. Add a numeric field to the Rows area
  2. Right-click any number in the Pivot Table → Group…
  3. Set: Starting at (minimum), Ending at (maximum), By (bin width)
  4. Click OK
Group salary field: Start = 0, End = 200000, By = 25000
→ Creates salary bands: 0-24999, 25000-49999, 50000-74999…

Group invoice amounts: Start = 0, End = 1000000, By = 100000
→ Invoice size distribution analysis

25.7 Sorting & Filtering in Pivot Tables

Sorting

  • Click the dropdown arrow ▼ on any Row or Column field header → Sort A to Z / Z to A / More Sort Options
  • Sort by value: right-click any value cell in the Pivot Table → Sort → Smallest to Largest / Largest to Smallest. The rows/columns reorder based on the selected value field.
  • For custom sort orders (Jan, Feb, Mar...) see the Sort dialog's "More Options"

Filtering in Pivot Tables

Filter MethodHow
Row/Column filter dropdownClick the dropdown ▼ on the Row or Column field → untick values to hide, or use Label Filters / Value Filters / Date Filters for more options
Report Filter (Filters area)Drag a field to the Filters area → a dropdown appears above the Pivot Table → select a value to filter the entire table to that value
SlicerPivotTable Analyse → Insert Slicer → select fields. Clickable button panels that filter visually and can connect to multiple Pivot Tables.
TimelinePivotTable Analyse → Insert Timeline → select date field. A continuous date range selector for time-based filtering.
Top 10 FilterRow/Column dropdown → Value Filters → Top 10… → set top/bottom N items by any value field. Shows only the top N rows/columns by a selected measure.

25.8 Calculated Fields & Items

A Calculated Field creates a new virtual field in the Pivot Table using a formula that references other fields. It appears as a new column in the Values area and is calculated on the summarised data.

Creating a Calculated Field

  1. Click inside the Pivot Table
  2. PivotTable Analyse → Calculations → Fields, Items & SetsCalculated Field…
  3. The Insert Calculated Field dialog opens:
    • Name: type the name for the new field (e.g., "Profit Margin")
    • Formula: type a formula using field names (e.g., = Revenue - Cost or = Revenue / Units)
    • Double-click any field name in the Fields list to insert it into the formula
  4. Click Add → OK
  5. The new calculated field appears as a column in the Values area and behaves like any other value field
Calculated field examples:
Profit           = Revenue - Cost
Gross Margin %  = (Revenue - Cost) / Revenue
VAT Amount      = Revenue * 0.15
Avg Revenue/Unit = Revenue / Units
Commission      = Revenue * CommissionRate
Calculated Field Limitation: Calculated fields operate on the sum of fields, not on individual rows. For example, a calculated field =Revenue/Units gives the total revenue divided by total units for a group — not the average revenue per unit across individual rows. For row-level calculations, add the formula to the source data as a new column before creating the Pivot Table.

25.9 Pivot Charts

A Pivot Chart is a chart that is directly linked to a Pivot Table. When you filter, sort, or change the Pivot Table, the Pivot Chart updates automatically. It has filter buttons built into the chart itself, making it interactive without needing separate slicers.

Creating a Pivot Chart

  1. Click anywhere inside the Pivot Table
  2. PivotTable Analyse tab → Tools group → PivotChart
  3. The Insert Chart dialog opens — choose the chart type (Column, Bar, Line, Pie, etc.)
  4. Click OK — the Pivot Chart appears, linked to the Pivot Table

— or —

  1. Insert tab → Charts group → PivotChart (this creates a new Pivot Table AND Pivot Chart from source data simultaneously)

Pivot Chart Filter Buttons

A Pivot Chart automatically shows field filter buttons at the bottom of the chart. These are interactive — clicking them filters both the chart and the connected Pivot Table. To hide the filter buttons for a cleaner chart appearance: right-click any filter button on the chart → Hide All Field Buttons on Chart.

Pivot Chart vs Regular Chart

AspectRegular ChartPivot Chart
Data sourceFixed cell rangeConnected Pivot Table (dynamic)
FilteringNo built-in filter controlsBuilt-in filter buttons; responds to Slicers
FlexibilityStatic; must manually change source data to updateDrag-and-drop fields to change what is charted; always reflects the current Pivot Table
ComplexityCan plot any data arrangementLimited to the Pivot Table's current structure

25.10 SA Business Pivot Table Examples

Example 1: Sales Summary Report

Source: Date | Region | Salesperson | Product | Revenue | Units

Rows: Region → Salesperson (nested)
Columns: Quarter (grouped from Date field)
Values: Sum of Revenue (formatted as R#,##0)
       Count of invoices (drag Region to Values = Count)
Filters: Year

Result: Revenue by region and salesperson for each quarter, filterable by year.

Example 2: HR Headcount and Payroll Analysis

Source: EmpID | Name | Department | Grade | Salary | Start Date

Rows: Department
Values: Count of EmpID (headcount per department)
       Sum of Salary (payroll per department)
       Average of Salary (average salary per department)
       Max of Salary (highest salary per department)
       Min of Salary (lowest salary per department)

Add Show Values As → % of Grand Total on Sum of Salary
→ Each department's share of the total payroll bill.

Example 3: Invoice Age Analysis

Source: Invoice# | Customer | Amount | Date | Status

Add helper column to source: =TODAY()-Date (Days Outstanding)

Rows: Customer
Columns: Status (Paid, Unpaid, Overdue)
Values: Sum of Amount
Group Days Outstanding: 0-30, 31-60, 61-90, 90+
→ Classic Accounts Receivable age analysis (debtor's book)

25.11 Quick Self-Check

Q1: You have a flat table with 5,000 rows of sales transactions: Date, Region, Product, Revenue, Quantity. Using a Pivot Table, what fields would you put in which areas to show total revenue by product for each region?

✓ Rows area: Region (each region becomes a row). Columns area: Product (each product becomes a column header). Values area: Sum of Revenue (the total revenue appears at the intersection of each region/product combination). Optionally: Filters area: Date or Year (to filter by time period). The result is a cross-tabulation (matrix) with regions in rows, products in columns, and revenue totals in each cell — showing at a glance which products perform best in which region. With 9 SA provinces and say 20 products, you get a 9×20 summary matrix from 5,000 raw rows in about 30 seconds.

Q2: Your Pivot Table shows Revenue by Region but you want to also see what percentage of the total revenue each region represents, without adding any formulas to the source data. How do you do this?

✓ Drag the Revenue field into the Values area a second time (so it appears twice). Then for the second Revenue field: right-click any value in that column → Show Values As → % of Grand Total. The second column now shows each region's revenue as a percentage of the overall total. Format the second column as Percentage (right-click → Number Format → Percentage). Rename the second field header to "% of Total" by clicking Value Field Settings → Custom Name. The Pivot Table now shows both the absolute revenue AND the percentage share side-by-side without any source data changes.

Q3: Your source data has individual transaction dates. After creating the Pivot Table with Date in the Rows area, you see individual dates (01/01/2025, 02/01/2025, etc.) instead of a monthly summary. How do you group them by month and year?

✓ Right-click any date value in the Pivot Table Rows area → Group… → in the Grouping dialog, hold Ctrl and click both Months and Years in the list (so both are selected/highlighted) → click OK. The Pivot Table now groups daily dates into Year → Month hierarchy. Clicking + next to a year expands it to show the months within that year. If you only want months (not the year level), select only Months in the dialog. Note: if the grouping option is greyed out, it usually means there are text values or blank cells in the date column of the source data — fix those first.

Q4: You update 200 new rows in the source data table. The Pivot Table still shows the old totals. What do you do to see the updated data?

✓ The Pivot Table must be refreshed manually. Right-click anywhere inside the Pivot Table → Refresh. Or: PivotTable Analyse tab → Data group → Refresh. Or press Alt+F5. To refresh all Pivot Tables in the workbook at once: PivotTable Analyse → Data → Refresh All, or Ctrl+Alt+F5. If the source data is an Excel Table (Ctrl+T), only a Refresh is needed — the Pivot Table will include all rows in the Table. If the source is a plain range, you must also verify that the data range in "Change Data Source" includes the new rows, otherwise the Pivot Table will not see them even after refresh.

Q5: You need a Pivot Table that shows Revenue by Region, but you also need a "Profit Margin %" column calculated as (Revenue - Cost) / Revenue for each region. Revenue and Cost are both fields in your source data. How do you add the Profit Margin calculation to the Pivot Table?

✓ Use a Calculated Field: click inside the Pivot Table → PivotTable Analyse → Calculations → Fields, Items & Sets → Calculated Field. Name: "Profit Margin %" and Formula: =(Revenue-Cost)/Revenue. Click Add → OK. The new field appears as an additional column in the Values area. Format it as percentage: right-click values in the new column → Number Format → Percentage → 2 decimal places. Note that this calculated field operates on the aggregated values (total revenue minus total cost, divided by total revenue for each region) rather than on individual row values, which is the correct behaviour for a regional profit margin summary.

Q6: What is the main advantage of using an Excel Table (Ctrl+T) as the source for a Pivot Table, compared to using a plain cell range?

✓ When the Pivot Table source is an Excel Table, any new rows added to the bottom of the Table are automatically included in the Pivot Table the next time you Refresh — no need to update the source range. With a plain cell range (e.g., $A$1:$F$5000), if new rows are added below row 5000, they fall outside the defined range and the Pivot Table misses them even after Refresh. You would have to go to PivotTable Analyse → Change Data Source and manually extend the range to include the new rows. The Table approach eliminates this maintenance overhead entirely. Additionally, Table column names are always used as Pivot Table field names regardless of position, so inserting or reordering columns in the source does not break the Pivot Table field references.

✓ Module 25 Complete — You Have Learned:

  • Pivot Table concept — dynamic summary table; the 4 areas (Rows, Columns, Values, Filters) with their purpose and example fields; diagram showing area layout
  • Creating Pivot Tables — source data requirements (flat table, unique headers, single data types, Excel Table preferred); Insert → PivotTable dialog; New vs Existing Worksheet; Fields pane drag-and-drop; ticking checkboxes for auto-placement; removing fields
  • PivotTable Analyse tab — all 8 groups (PivotTable, Active Field, Group, Filter, Data, Actions, Calculations, Tools, Show); critical Refresh operation (right-click or Alt+F5); Refresh All (Ctrl+Alt+F5)
  • Value Field Settings — 9 aggregation functions (Sum, Count, Average, Max, Min, Product, Count Numbers, StdDev, Var); Show Values As (9 options: % Grand Total, % Column/Row Total, Running Total, % Running Total, Rank S→L/L→S, Difference From, % Difference From); Number Format via field settings
  • Design tab — Report Layout (Compact, Outline, Tabular); Subtotals (none/top/bottom); Grand Totals (rows/columns/both/neither); PivotTable Styles gallery (Light/Medium/Dark); Style Options (Banded Rows/Columns, Row/Column Headers)
  • Grouping — date grouping (right-click → Group; Days/Months/Quarters/Years; SA financial year start/end); number grouping into bins (Start/End/By settings); salary bands and invoice size distribution examples
  • Sorting and filtering — dropdown A-Z/Z-A; sort by value (right-click); Row/Column label filters; report filter dropdown; Slicer and Timeline; Top 10 Value Filter
  • Calculated Fields — PivotTable Analyse → Fields, Items & Sets → Calculated Field; Name and Formula using field names; operates on aggregated values (not row-level); limitation (row-level calcs should be in source data)
  • Pivot Charts — creating (PivotTable Analyse → PivotChart or Insert → PivotChart); linked to Pivot Table; built-in filter buttons; hiding filter buttons; Pivot Chart vs regular chart comparison table
  • SA business examples — sales summary (region × quarter matrix); HR payroll analysis (headcount + sum + avg + max + min salary + % of total); invoice age analysis (debtor’s book with Days Outstanding grouping)

← Back to All Modules