Excel Advanced - Pivoting Data
Pivoting Data
Rearrange one dependable dataset into different analytical views without rewriting formulas, then filter the results interactively with slicers and timelines.
Learning outcomes
Download the practice dataset
The page reconstructs the original 120 fictional transactions used throughout the course. The generated workbook contains Sales Data, Pivot Tasks and Controls sheets.
1. Prepare the PivotTable source
Audit the source before pivoting
- Open Sales Data and select a cell within A4:P124.
- Confirm one header row, 120 uninterrupted records and no merged cells or subtotal rows.
- Check that Date contains real dates and Revenue, Cost and Profit contain numbers.
- Optionally press Ctrl+T and name the Table tblSales; a Table expands more safely when new records are added.
Controls: 120 records, Revenue RM146,236 and Profit RM56,646.
2. First PivotTable: revenue by region
Create and rearrange fields
- Choose Insert → PivotTable and verify the full source.
- Place the PivotTable on a new worksheet named PT Revenue Region.
- Drag Region to Rows and Revenue (RM) to Values.
- Open Value Field Settings and confirm Sum, not Count.
- Format the values as RM through Value Field Settings → Number Format.
Region
—
Sum of Revenue
—
| Region | Revenue |
|---|---|
| Central | RM30,090 |
| East | RM12,682 |
| North | RM59,679 |
| South | RM43,785 |
| Grand Total | RM146,236 |
3. Profit by category
Summarise and sort category profit
- Create another PivotTable from the same source.
- Place Category in Rows and Profit (RM) in Values.
- Sort Sum of Profit Largest to Smallest.
- Double-click a value to drill down into the transactions behind it; Excel creates a detail sheet.
| Category | Profit |
|---|---|
| Furniture | RM34,668 |
| Accessories | RM21,978 |
| Grand Total | RM56,646 |
4. Monthly revenue and date grouping
Group dates into months and quarters
- Place Date in Rows and Revenue in Values.
- Right-click any date and choose Group.
- Select Months and Quarters; include Years if the source may later span several years.
- Add Region to Filters.
- Expand or collapse the quarter hierarchy.
Checkpoint: the PivotTable shows all 12 months and still totals RM146,236.
5. Channel mix
Use both Rows and Columns
- Place Channel in Rows.
- Place Region in Columns.
- Place Revenue in Values.
- Move Region from Columns to Filters and observe how the question changes.
- Restore Region to Columns.
Row totals: Corporate RM56,728; Online RM50,154; Retail RM39,354.
This exercise demonstrates “pivoting”: moving a field changes the report structure without altering the source.
6. Average order value and Show Values As
Change the value calculation
- Place Region in Rows and Revenue in Values.
- Open Value Field Settings → Summarise Values By → Average.
- Rename the field Average Order Value.
- Add Revenue to Values a second time.
- For the second copy, use Show Values As → % of Grand Total.
Average order values: Central RM1,003.00; East RM422.73; North RM1,989.30; South RM1,459.50.
Other useful “Show Values As” choices
Difference From compares periods; % Difference From shows growth; Rank Largest to Smallest identifies top performers; Running Total creates cumulative analysis.
7. Refresh, source changes and formatting
Maintain the PivotTable
- Edit one Revenue value in Sales Data and note that the PivotTable does not update immediately.
- Right-click the PivotTable and choose Refresh.
- Undo the test change and refresh again.
- Use PivotTable Analyze → Change Data Source to verify all records are included.
- Compare Compact, Outline and Tabular report layouts.
- Apply a restrained style, clear field names and RM number formats.
8. Slicers and timelines
Add interactive filters
- Select a PivotTable and choose PivotTable Analyze → Insert Slicer.
- Add a Channel slicer and test multi-select and Clear Filter.
- Choose Insert Timeline and select Date.
- Switch the timeline between Months and Quarters.
- Use Report Connections or PivotTable Connections to connect the slicer to compatible PivotTables.
Troubleshooting
The source may contain text. Convert the field to numbers, refresh and choose Sum.
Remove blank, text or invalid dates, then refresh.
Change the source range or use an Excel Table and refresh.
Use Report Connections; PivotTables must share a compatible cache/source.
Knowledge check
1. Does a PivotTable change the source data?
No. It summarises a cached view of the source. Refresh when the source changes.
2. Why use Value Field Settings for number formatting?
Formatting applied there survives layout and refresh changes more reliably than ordinary cell formatting.
3. What happens when you double-click a PivotTable value?
Excel creates a new sheet containing the source records behind that value.
4. Why might a slicer not connect to another PivotTable?
The PivotTables may use different sources or PivotCaches, making them incompatible for one shared control.
Completion checklist
- Records: 120
- Total Revenue: RM146,236
- Total Profit: RM56,646
- Regions: Central, East, North and South
- Channels: Corporate, Online and Retail
- Grouped periods: 12 months / 4 quarters
- Interactive controls: Channel slicer and Date timeline
Next lesson: turn these PivotTable views into interactive PivotCharts and a compact dashboard.