- Learn
- Computer Science & IT
- Digital Skills
- Data Analysis with Spreadsheets
- Summarizing Data with PivotTables
Summarizing Data with PivotTables
IntermediateLesson 2 of 7 in Data Analysis with Spreadsheets Course
What you will learn
- Get source data into a shape a PivotTable can read, build a summary by placing fields in rows, columns, values and filters, and keep it up to date as the data changes.
- Prepare source data for a PivotTableArrange data as one list with a single header row, one record per row and one kind of value per column, and fix the problems that make a PivotTable wrong or impossible to build.
- Build a PivotTable from rows, columns, values and filtersInsert a PivotTable, plan which field goes into which area to answer a question, and read and explore the summary it produces.
- Keep a PivotTable up to dateRefresh a PivotTable after its source changes, extend its source range, and recognize why a PivotTable can show outdated figures.
- Prepare source data for a PivotTable
- Choose how each value is summarized so the numbers answer the question, and lay out and format the report so it is easy to read.
- Summarize by sum, count, average and other functionsPick the summary function that matches the question, understand the defaults Excel chooses, and avoid the classic errors with counts and averages.
- Lay out and format the reportChoose a report layout, control subtotals and grand totals, sort the items and format the value fields so the PivotTable reads clearly.
- Summarize by sum, count, average and other functions
- Combine detailed dates, numbers and labels into larger groups such as months, quarters, size bands or custom categories, so patterns become visible.
- Group dates into periodsGroup a date field into days, weeks, months, quarters or years, and handle the year, week and data-type issues that come with it.
- Group numbers and itemsTurn a numeric field into equal ranges and combine selected labels into custom groups, choosing ranges and groups that suit the question.
- Group dates into periods
- Limit a PivotTable to the records that matter with filter fields, label and value filters, slicers and timelines, and read totals correctly when filters are on.
- Filter with the Filters area and field filtersUse a filter field, item lists, label filters and value filters such as Top 10, and understand how filters change totals and percentages.
- Filter with slicers and timelinesAdd slicers and timelines as visible, clickable filters, combine them, and connect one slicer or timeline to several PivotTables.
- Filter with the Filters area and field filters
- Show values as shares, differences, running totals and ranks, and add calculated fields that compute new measures from the summarized values.
- Show values as percentages of totalsDisplay values as percentages of the grand total, the row or column total, a parent total or a chosen base item, and pick the base that matches the question.
- Compare periods, accumulate and rankShow differences from a base item, running totals, ranks and the index, and set the base field and base item correctly.
- Add calculated fieldsCreate a calculated field from other fields, predict what it calculates in every cell and total, and decide when a helper column in the source is the better choice.
- Show values as percentages of totals
Summarizing Data with PivotTables study guide
1Prepare data and build a PivotTable
A useful summary starts with a reliable list. You will turn source columns into fields, place those fields to answer a specific question, and check what each result includes. You will also keep the report current as records change or new rows arrive. The same source can support several views, so learn to separate the data itself from the layout and the stored copy that a PivotTable uses.
1.1 Prepare source data for a PivotTable
A PivotTable summarizes records without changing the source list. A column is a field, such as Date, Region or Revenue. A row is a record, such as one order. Before inserting a report, make sure every row describes the same kind of thing.
Give every column one clear job
Use one header row with a distinct, nonblank name above each column. Excel turns those names into its field list. An empty header can stop creation with "The PivotTable field name is not valid." Remove merged cells and headings spread across two rows. Keep a report title outside the selected source.
Keep the list in one continuous block. A completely blank row can end Excel's automatic range selection, leaving later records out. Remove subtotal and total rows from the records. If ten orders total 2,110 and a typed "Total" row also contains 2,110, the PivotTable adds both and reports 4,220. It cannot recognize that the last row already summarizes the others.
Fix types and labels
Revenue must contain real numbers. A number stored as text may look correct while causing Excel to choose Count instead of Sum. Convert the source values with Text to Columns, VALUE or a suitable data type in Power Query. Dates must also be real dates: formatting text to look like a date does not turn it into one. DATEVALUE or a data conversion can help.
Check category labels before trusting the groups. "North", "North " and "Nrth" become separate items. TRIM removes extra spaces; Find and Replace can correct a known spelling. Clean the source so that later reports use the same labels.
A blank category appears as "(blank)". A blank numeric cell can make Count the default summary. Fill a missing value only when you know it. Zero means a measured or recorded zero; it should not stand for an unknown value. That distinction matters when you later calculate averages.
Keep repeated measures in one column
A wide list with Region, Jan, Feb and Mar has three separate revenue fields. A long list has Region, Month and Revenue, with one row per region per month. Three regions over three months make nine records.
The wide list can display Jan, Feb and Mar as separate Values fields, even vertically by moving "Σ Values" to Rows. But it has no single Month field to filter, group or slice. Every new month also requires another value field. Unpivot Columns in Power Query can reshape it into the long list.
Let the source grow
Click inside the cleaned list and press Ctrl+T. Confirm that the table has headers, then give it a clear name such as "tblSales" on Table Design. Build the PivotTable from that table name. Rows added to the table enter the report at the next refresh.
A fixed source such as A1:E11 includes only those cells. Typing the next order below row 11 does not extend that source. Check both the selected range and a known source total before treating a new report as complete.
Key Takeaways
- Use one header row and one record per row; keep totals outside the records.
- Convert text numbers and text dates before summarizing or grouping.
- Consistent labels prevent one category from splitting into several items.
- A long layout gives repeated measures one field to group and filter.
- An Excel table includes added rows at the next refresh.
1.2 Build a PivotTable from rows, columns, values and filters
Start with the question you want the report to answer. "What was revenue for each product in each region?" names a measure, Revenue, and two categories, Product and Region. Those roles tell you where the fields belong.
Insert and place fields
Click a source cell and choose Insert > PivotTable > From Table/Range. Check the table or range, choose a new worksheet or an existing-sheet location, and click OK. Leave room around the report for more rows and columns. The PivotTable Fields pane shows the available fields and four areas.
| Area | What it does | Example |
|---|---|---|
| Rows | Lists category items down the side | Region |
| Columns | Lists category items across the top | Product |
| Values | Calculates a result for each combination | Sum of Revenue |
| Filters | Limits the whole report without listing that field in the body | Date |
Drag fields into the areas yourself. Checking a field lets Excel choose a starting position: nonnumeric fields normally go to Rows and numeric fields to Values. Drag a field between areas to pivot the view, or out of the pane to remove it. Recommended PivotTables offers starting layouts on the Insert tab.
Read a cross-table
With Region in Rows, Product in Columns and Revenue in Values, the ten-order example gives:
| Region | Tea | Coffee | Total |
|---|---|---|---|
| North | 450 | 300 | 750 |
| South | 400 | 960 | 1,360 |
| Grand Total | 850 | 1,260 | 2,110 |
North–Tea is 450 because the three matching orders are 200, 100 and 150. A value cell summarizes all records that match its row, column and active filters. It does not have to correspond to one order.
If Region appears as a count, it is in Values; move it to Rows or Columns to see names. If Revenue appears as a long list of amounts down the side, move it from Rows to Values and choose the needed summary.
Build a hierarchy or add measures
Put Region above Product in Rows to show products inside each region, with region subtotals. Reverse the order to show regions inside each product, with product subtotals. The underlying combinations stay the same, but the outer field controls the main grouping.
Add Units to Values beside Revenue to compare volume and revenue. Excel adds "Σ Values" when several measures are present. Move it from Columns to Rows to stack those measures. You can also add Revenue twice, then give the copies different calculations. Product can be in Rows while Count of Product is in Values, counting the orders for each product.
Open the detail behind a result
Double-click North–Tea's 450. Show Details creates a new worksheet containing its three source records. Use that copy to investigate an unexpected amount. Editing the extracted sheet changes neither the original source nor the PivotTable; corrections belong in the source.
Google Sheets uses Insert > Pivot table. Its editor offers Add under Rows, Columns, Values and Filters, and double-clicking a result also opens its contributing records on a new sheet.
Key Takeaways
- Choose categories for Rows and Columns and a measure for Values.
- The outer row field determines the main grouping and subtotals.
- Each value summarizes all matching records under the active filters.
- Add several value fields or duplicate a field for different calculations.
- Show Details extracts a copy of the contributing records.
- Moving fields changes the report layout without changing the source.
1.3 Keep a PivotTable up to date
A PivotTable summarizes a stored copy of its source, called the PivotCache. Changing the worksheet does not by itself guarantee that the displayed result has changed. Treat refreshing as part of preparing the report for use.
Refresh the stored data
Suppose North–Tea totals 450. You correct an order from 200 to 260 in the source. The old cache still gives 450; after refresh the report gives 510.
Refresh one report with right-click > Refresh, PivotTable Analyze > Refresh, or Alt+F5. Data > Refresh All or Ctrl+Alt+F5 updates the workbook's PivotTables and data connections. To refresh when a workbook opens, enable "Refresh data when opening the file" on the Data tab of PivotTable Options.
Some Microsoft 365 versions offer Auto Refresh for local workbook data. Its setting applies to the source and affects the PivotTables connected to it. Where it is unavailable or off, and for external sources, use the refresh commands. Check the result after a source change before sharing it.
Separate refreshing from extending the source
A refresh rereads the source already assigned to the PivotTable. A fixed range A1:E11 still ends at row 11 even if rows 12–15 contain new orders. Select PivotTable Analyze > Change Data Source and extend it to A1:E15, then refresh.
A named Excel table grows when rows are added to it. When the PivotTable uses the table as its source, refreshing includes those rows. Verify that the new rows actually belong to the table: a nearby worksheet row is not automatically part of the source merely because it looks similar.
Refreshing preserves the field layout. New products become available as new items. Renaming a source header is different: the old field is no longer found and can disappear from the layout. Add the renamed field again, then check its summary function and format.
Keep space and formatting stable
On the Layout & Format tab of PivotTable Options, clear "Autofit column widths on update" to keep chosen widths. Enable "Preserve cell formatting on update" to retain cell formatting. These are separate choices: keeping a format does not stop a column from widening.
A growing report needs clear cells below and beside it. In current Excel for Microsoft 365, blocked output can produce #SPILL! in place of the report. Use "Select Obstructing Cells" from the error menu, then move or clear the blockage, or move the PivotTable. Older versions display an overlap warning instead. Keep notes away from the area where new items will appear.
Recognize a shared cache
Several PivotTables from one source can share a PivotCache. Refreshing the shared data updates their results together. Groupings and calculated fields also belong to that cache, so a date grouping created in one report can appear in another.
If two reports unexpectedly acquire the same grouping, inspect their shared source and cache before rebuilding the data. If a displayed number is wrong, edit the source and refresh; Excel does not let you replace a calculated value by typing over it.
Key Takeaways
- Refresh updates the PivotCache from the assigned source.
- Extend a fixed source range when records are added beyond it.
- Reports sharing a cache also share groupings and calculated fields.
- Keep the output area clear so the PivotTable can grow.
2Summarize values with the right calculation
The same records can answer questions about totals, order counts, typical amounts or extremes. Choosing a summary function gives the numbers their meaning; choosing a layout and number format makes that meaning visible. You will check what Excel counts, see why an overall average can differ from the average of group averages, and make a report that stays readable when you rearrange or refresh it.
2.1 Summarize by sum, count, average and other functions
The Values area needs a summary function for each field. Change it through right-click > Summarize Values By or through Value Field Settings. Choose the function from the question, then inspect its effect on the report heading and total.
Match the function to the question
For the ten-order example, each region has five orders. North's revenue totals 750; South's totals 1,360.
| Function | Question answered | North | South |
|---|---|---|---|
| Sum | How much in total? | 750 | 1,360 |
| Count | How many filled revenue cells? | 5 | 5 |
| Average | How much per numeric order value? | 150 | 272 |
| Max | What is the largest order? | 200 | 420 |
| Min | What is the smallest order? | 100 | 150 |
Count includes nonempty cells of any type. Count Numbers includes numeric cells only. To count records reliably, use a field filled on every row, such as Order ID. Count of Region over ten orders returns 10, even though only two different regions exist. Distinct Count counts different items; Excel offers it when the source was added to the Data Model at creation.
Other functions serve narrower questions. Product multiplies numeric values. StdDev and Var estimate population spread from sample records; StdDevp and Varp calculate spread when the records are the whole population. Choose the sample or population version according to what the records represent.
Inspect Excel's default
Excel normally chooses Sum for a fully numeric field and Count when text or blanks occur. If Revenue shows as Count, inspect the source for text numbers and blanks. Correct the data, refresh, and select Sum if needed. Changing the function alone does not convert text values into numbers.
Zeros and blanks have different effects. Average and Count Numbers skip blank cells but include zero. For values 100, 0 and 200, Average is 100. If the middle entry is blank, the average is 150 because only two numeric values remain. Count also includes zero as a filled cell and skips a true blank.
Read the overall average correctly
An Average grand total is recalculated from all contributing records. Store A has four orders averaging 50, so its sum is 200. Store B has one order worth 200. The combined sum is 400 across five orders, giving an overall average of 80.
Averaging the two displayed averages gives 125. That treats each store as one equally weighted observation, although one store contributed four orders and the other only one. The PivotTable's total answers the per-order question.
Rates need the same care. With five Tea orders priced at 5 per unit and five Coffee orders priced at 12, Average of Price is 8.50: an equal-weight average over orders. The price per unit sold is total revenue 2,110 divided by total units 275, or 7.67. A calculated field using =Revenue/Units gives that ratio of totals.
In Google Sheets, choose Summarize by in the Values editor. COUNTA counts filled cells, COUNT counts numeric cells, and COUNTUNIQUE counts different values.
Key Takeaways
- The summary function determines whether a result is a sum, count, average or extreme.
- Count uses filled cells; Distinct Count uses different items.
- Zeros enter averages, while true blanks are skipped.
- An Average total uses the underlying records and their unequal group sizes.
- A per-unit rate is a ratio of totals, not necessarily an average of row rates.
2.2 Lay out and format the report
A report should make its categories, calculations and totals easy to identify. Start with the layout that suits how the result will be read, then set formats on the value fields so they travel with the numbers.
Choose the row layout
Design > Report Layout offers three forms.
| Form | Row fields | Typical use |
|---|---|---|
| Compact | Share one column; inner items are indented | A narrow report read on screen |
| Outline | Have separate columns; subtotals initially appear above groups | A hierarchy with visible field columns |
| Tabular | Have separate columns; subtotals initially appear below groups | A report shaped like a flat table |
Use Repeat All Item Labels in Outline or Tabular form to fill the outer label into every detail row. This is useful when you copy the report as a list: each product row then carries its region. In Compact form, the indents carry the hierarchy instead.
Design > Subtotals controls whether subtotals appear and where they sit. Design > Grand Totals separately controls totals for rows, columns or both. With Region above Product in Rows, removing subtotals removes North 750 and South 1,360 as subtotal lines, while the overall 2,110 can remain. Read the labels before treating a visible total as the full report total.
Apply formats to the field
Open Value Field Settings > Number Format. Choose separators and a suitable number of decimal places, or Percentage for a share. This format belongs to the whole value field and stays with it when the layout changes or the report is refreshed.
A Home-tab format applies to the selected worksheet cells. Those cells may hold different parts of the report after pivoting. Field-level formatting avoids a new percentage appearing with the amount's format or new values appearing with uneven decimals. For whole order counts, use zero decimal places; for an average such as 7.67, use enough places to show the useful precision.
Rename "Sum of Revenue" to "Total revenue" through Custom Name in Value Field Settings. A value field cannot use exactly the same name as an existing source field. "Revenue" therefore conflicts with the source name; "Total revenue" is clearer. Replace an unhelpful "Row Labels" heading with the field's name where appropriate.
Show gaps and order the result
An empty value cell can indicate that no source records match that row-and-column combination. PivotTable Options > Layout & Format > For empty cells show lets you display 0 there. This changes the display; it does not insert a record into the source.
To list existing field items even when they have no records under the current view, use Show items with no data on the field's Layout & Print tab. Displaying a blank as zero and displaying an absent item are different choices.
Sort labels A to Z, or click a result and sort Largest to Smallest by its value. With Region above Product, a value sort orders products within each region: North has Tea 450 before Coffee 300, while South has Coffee 960 before Tea 400. Drag items for a custom order when needed. Leave space for the report to expand after refresh.
Key Takeaways
- Compact, Outline and Tabular forms present the same hierarchy differently.
- Subtotals and grand totals have separate controls.
- Set Number Format through Value Field Settings so it follows the field.
- Use a clear custom name that differs from the source field name.
- Displaying zero in empty cells does not create source records.
- Sort by values to compare items and by labels to find them.
- Repeat outer labels when copying a report as a flat list.
3Group dates and numbers
Detailed dates and amounts can hide a useful pattern in a long list of labels. Grouping combines those labels into periods, number ranges or named categories while leaving the source records intact. You will choose groups that fit the question, keep years and week boundaries clear, and decide when a category belongs in the source so that it stays useful as new records arrive.
3.1 Group dates into periods
A date field can produce a separate label for every order date. Grouping combines those dates into periods so you can compare months, quarters or years. The source still keeps the individual dates.
Group into calendar periods
Place Date in Rows, right-click one of its dates and choose Group. PivotTable Analyze > Group Field opens the same dialog. Select Months, Quarters, Years or a combination, and check Starting at and Ending at. Excel also offers Seconds, Minutes, Hours and Days for finer detail.
In the ten-order example, dates run from 2026-01-08 to 2026-03-27. Grouping by Months gives Jan 620, Feb 670 and Mar 820. Those three monthly sums total 2,110. Grouping by Quarters combines all three into Qtr1.
The period name alone does not identify its year. Months groups every January together if the source covers several years. Select Years and Months to keep January 2025 separate from January 2026. The new Years field forms the outer level. Use Years with Quarters for the same reason.
Recent Excel versions may create Months, Quarters and Years fields automatically when you add Date to the layout. Expand or collapse with the + and − buttons, or remove an unneeded level from the layout. Right-click > Ungroup restores individual dates. File > Options > Data includes "Disable automatic grouping of Date/Time columns in PivotTables" if you want to choose grouping yourself.
Set the start of a week
For seven-day groups, select Days alone and set Number of days to 7. Starting at fixes the weekday boundary. Starting at 2026-01-05 creates a Monday-to-Sunday group from 2026-01-05 through 2026-01-11. The next group begins on 2026-01-12.
Orders on 2026-01-08, 2026-01-15 and 2026-01-22 therefore fall in three different groups. Starting the sequence on a different weekday changes which orders are grouped together. Excel enables Number of days only when Days is the sole selected unit, so do not also select Months for this grouping.
Check types and the reporting calendar
Date grouping needs real dates. Text entries and blanks can cause "Cannot group that selection" or leave Group Field unavailable. Inspect the source, convert text dates, resolve blanks, refresh and try again.
Grouped months sort in calendar order. Keep that order for later period differences or running totals. A value sort can put the largest month first, which changes what "previous" means in an ordered calculation.
Calendar Qtr1 runs from January through March. For a fiscal year beginning in another month, create the required fiscal period in a helper column in the source. Renaming a calendar-quarter label does not change the records assigned to it.
Grouping belongs to the PivotCache, so reports sharing that cache can acquire the same grouped fields. In Google Sheets, use Create pivot date group from a date's right-click menu. Year-Month keeps months from different years separate.
Key Takeaways
- Group real dates into periods without changing their source values.
- Include Years when the same month or quarter occurs in different years.
- A seven-day group uses Days alone and a chosen starting weekday.
- Calendar quarters need a source helper field for a different fiscal calendar.
- Shared caches can share date groupings.
3.2 Group numbers and items
Grouping numbers into ranges makes a distribution easier to read. Grouping labels by hand combines chosen items into named categories. Both methods add a grouping to the report while keeping the original source values.
Build a frequency table
Put Revenue in Rows so its amounts are labels that can be grouped. Put a count of a reliably filled field, such as Date or Order ID, in Values. This asks how many orders fall in each range. Revenue in Values alone would summarize amounts instead of creating ranges.
Right-click a numeric row label and choose Group. Set Starting at to 100, Ending at to 499 and By to 100. For orders worth 200, 300, 120, 150, 100, 420, 180, 250, 150 and 240, the report gives:
| Revenue range | Order count |
|---|---|
| 100–199 | 5 |
| 200–299 | 3 |
| 300–399 | 1 |
| 400–499 | 1 |
The counts total ten. Half the orders are below 200, while only two are 300 or higher. Summing Revenue in Values would answer how much revenue each band contributes, a different question from how many orders it contains.
Read boundaries and choose a width
With width 100 starting at 100, a range includes its lower boundary and stops before the next range begins. The label "100-199" also contains 199.50; 200 belongs in the next range. Values below Starting at or above Ending at have separate outside groups marked with less-than or greater-than labels.
Choose the width from the question and the spread of values. Very narrow ranges leave many tiny groups and make the pattern hard to see. A few extremely broad ranges can hide differences. About five to ten ranges often make a readable starting view; revise them when the question calls for a particular band size. Ranges with no records are hidden unless Show items with no data is enabled.
Text or blank entries in a numeric field can block grouping. Fix the source values, refresh and group again. Formatting text as Number does not convert it into numeric data.
Combine labels into categories
Ctrl+click "Green tea" and "Black tea" in the row labels, then right-click > Group. Excel adds an outer field such as Product2 and places those items under Group1. Rename Group1 to "Tea" and use Field Settings > Custom Name to name the new field "Category". Unselected products remain separate groups of their own. Right-click a group and choose Ungroup to remove it.
A manual group does not teach the source that all future tea products belong there. When a new product arrives after refresh, inspect its category. For a category used across many reports, add a Category column in the source, perhaps filled from a product lookup list. Maintaining that column keeps the classification reusable.
Google Sheets provides Create pivot group rule for numeric intervals and Create pivot group for selected labels.
Key Takeaways
- Place a numeric field in Rows or Columns before grouping it into ranges.
- Count records in Values to show frequencies within those ranges.
- The next lower boundary starts the next range, even for decimal values.
- Manual label groups need checking when new items arrive.
4Filter PivotTables interactively
A useful report often needs a smaller view of the data: one region, a few products or a particular span of dates. Filters let you choose that view without editing the source. You will select items by name or by summarized value, make selections visible with slicers, and use timelines for date ranges. Each filtered total must be read with the selection that produced it.
4.1 Filter with the Filters area and field filters
A filter limits the records included in a PivotTable. It changes what the displayed totals describe. Choose the filter from the question: a named item, a label rule or a rule about summarized values.
Use a report filter
Drag Region to Filters. A drop-down above the report initially shows "(All)". Choose North to summarize only North's orders. With Product in Rows, Tea becomes 450, Coffee 300 and the Grand Total 750.
Enable Select Multiple Items to choose several regions. The filter cell then reads "(Multiple Items)", which does not name the selected regions. Check the drop-down before quoting the result, or use a slicer when readers need to see the selection continuously.
To create a separate report sheet for each region, use PivotTable Analyze > Options > Show Report Filter Pages and choose Region. Excel copies the PivotTable to a sheet for each item, filtered to that item. Each sheet still needs the normal source and refresh checks.
Choose a field-filter rule
Row and column field buttons offer three useful approaches.
| Filter | Tests | Example |
|---|---|---|
| Item list | Whether a named item is selected | Keep Tea and Coffee |
| Label filter | The item's label | Keep names containing "Tea" |
| Value filter | Its summarized value | Keep customers above 1,000 in total revenue |
A value filter tests the summarized result for the item, not each individual source row. A customer with several small orders can pass a revenue threshold when their orders add up to enough.
The Top 10 dialog is configurable. Open Value Filters > Top 10, then choose Top or Bottom, a number, Items/Percent/Sum and the value field. Top 3 Items by Sum of Revenue means three customer items with the largest total revenue; the dialog name does not force ten.
Follow the total through the filter
Customers Chen 7,800, Avila 5,200, Eriksen 4,400, Brandt 3,100, Fontaine 2,900 and Diallo 1,250 total 24,650. Top 3 keeps Chen, Avila and Eriksen, whose revenue totals 17,400. In a standard PivotTable the Grand Total now describes those retained customers.
Chen's share changes too: % of Grand Total is 44.83% of 17,400, compared with 31.64% of 24,650 before filtering. Keep an unfiltered report if you need a share of the full business alongside the selected customers.
For a region-specific Top 3, filter Region to that region before applying the customer value filter. Repeat the region selection to inspect another region’s largest customer totals.
Clear and recheck selections
Filters on different fields combine: each included record must pass all of them. A funnel icon marks an active field filter. Clear Filter From removes one field's restriction; PivotTable Analyze > Clear > Clear Filters removes the report's filters.
A label or value rule is reapplied as data changes after refresh. Item lists need checking when new items appear. A fresh source does not guarantee an unrestricted view.
Key Takeaways
- Report filters limit the report without adding that field to its body.
- Label filters test names; value filters test summarized results.
- Top 10 can select a different number of top or bottom items.
- Filtered totals and percentage bases describe the retained records.
- Check active filters and ranking scope before reporting results.
4.2 Filter with slicers and timelines
A slicer makes a field's filter visible as buttons. A timeline provides a date scale for selecting a continuous span. They help readers see what the current report includes while they change the view.
Add and use a slicer
Select the PivotTable, choose PivotTable Analyze > Insert Slicer, and select fields such as Region and Product. Click OK to add a panel for each field. A field can have a slicer even when it is absent from Rows and Columns.
Click South in Region to keep South's records. Then click Coffee in Product to keep South's Coffee orders, totaling 960. Selected buttons are highlighted; items with no records under the other active selections are dimmed.
Ctrl+click several buttons, or enable Multi-Select at the top of the panel. Two regions selected in one slicer mean North or South. Region and Product slicers combine as conditions: South and Coffee. Clear Filter, the funnel button with a red cross, removes that slicer's restriction. A slicer and the drop-down for the same field reflect the same selection.
Connect and arrange controls
Select a slicer and use Slicer > Report Connections to choose the PivotTables it controls. Reports must use a compatible shared source/cache. A Region slicer can filter both revenue by product and revenue by month when both reports are based on that data. A report from a different source cannot be connected just because it has a field named Region.
Right-click > Slicer Settings controls the caption, order and Hide items with no data. The Slicer tab sets style, size and the number of button columns. Give the most useful fields space; too many panels make the actual report hard to find.
Select dates on a timeline
Choose PivotTable Analyze > Insert Timeline and select a real date field. A text column that merely looks like dates is not a suitable date field. The control switches between years, quarters, months and days.
At the months level, drag across February and March 2026. In the ten-order example, the report includes 670 and 820, totaling 1,490. Clear Filter removes the date restriction. Report Connections links the timeline to other compatible PivotTables, as with a slicer.
A timeline selects one continuous range. It cannot select January and March while skipping February. For separated months, use a slicer on Months or a suitable date filter. If both a slicer and a timeline filter the same date field, enable Allow multiple filters per field on PivotTable Options > Totals & Filters.
Read the selected report
Before sharing a total, look at every active control. A timeline and a product slicer combine, so February–March with Coffee selected is only Coffee revenue for those months. A clear timeline does not remove a separate product selection.
Google Sheets adds a slicer through Data > Add a slicer. It filters one column and applies to pivot tables and charts on that sheet using the same data range. Sheets has no timeline control; use a date condition on a slicer for a date-based view.
Key Takeaways
- Slicer buttons show and change a field selection.
- Selections within a slicer are alternatives; different slicers combine conditions.
- Report Connections links a control to compatible PivotTables.
- A timeline filters one continuous span of real dates.
- Use a grouped-month slicer for separated months.
- Clearing one control leaves other active filters in place.
5Calculate with Show Values As and calculated fields
A total is often only the beginning of an analysis. You may need a share of a larger amount, growth from one period to the next, progress through the year or a rate made from two fields. You will choose the right comparison base and keep the original value beside the result. You will also predict calculations at the grand total, where an apparently reasonable formula can answer a different question.
5.1 Show values as percentages of totals
Show Values As changes the comparison displayed for an existing summarized value. It leaves the source and the summary function intact. Choose it by right-clicking a value or on the Show Values As tab in Value Field Settings.
Keep the amount beside the share
Add Revenue to Values twice. Leave one copy as the plain sum and change the second copy to a percentage. Give them clear names, such as "Total revenue" and "Share of total". No Calculation returns a copy to its plain summary. Excel for Mac places some choices under More Options.
The key decision is which total should represent 100%. Use the region/product report as an example:
| Region | Tea | Coffee | Total |
|---|---|---|---|
| North | 450 | 300 | 750 |
| South | 400 | 960 | 1,360 |
| Total | 850 | 1,260 | 2,110 |
Choose the denominator
| Display | Divides a cell by | Question |
|---|---|---|
| % of Grand Total | Overall report total | How much does this combination contribute overall? |
| % of Row Total | Its row total | What is each region's product mix? |
| % of Column Total | Its column total | What is each region's contribution to a product? |
For North–Tea, % of Grand Total divides 450 by 2,110, giving 21.33%. Its row share divides 450 by 750, giving 60.00%. Its column share divides 450 by 850, giving 52.94%. The numerator is unchanged; the question chooses the denominator.
The complete comparison shows how the same amount supports different questions:
| Cell | Grand-total share | Row share | Column share |
|---|---|---|---|
| North–Tea | 21.33% | 60.00% | 52.94% |
| North–Coffee | 14.22% | 40.00% | 23.81% |
| South–Tea | 18.96% | 29.41% | 47.06% |
| South–Coffee | 45.50% | 70.59% | 76.19% |
Each row's two product shares reach 100%; each product column's region shares also reach 100%. Do not add a row share to a column share: they describe different wholes.
Follow a hierarchy or a fixed base item
With Region above Product in Rows, % of Parent Row Total shows each product as a share of its own region. North–Tea is 60.00%. The outer North subtotal is itself 35.55% of the overall total, and South is 64.45%. % of Parent Column Total does the same for nested columns. % of Parent Total lets you select the parent field.
% Of is a different comparison: it divides by one base item in a chosen base field. Set Region as the base field and North as the base item. North is 100.00%; South is 181.33%, because 1,360 divided by 750 is about 1.81. This says South is about 1.81 times North, not that it contributes 181.33% of all revenue. The increase over North would be 81.33%.
Keep the base visible
Active filters change the records behind ordinary report totals, so a percentage can change when a slicer changes even if one cell's revenue does not. State the selected region or period beside the report when that context matters. To show a share of all records, use an unfiltered report.
Set percentage precision through Value Field Settings > Number Format. Rounding can make displayed shares add to 99.99% or 100.01%. Google Sheets offers % of row, % of column and % of grand total through Show as in the Values editor.
Key Takeaways
- Add a second copy of a value field to compare an amount with a share.
- Choose the total that should be 100% before selecting a percentage display.
- Parent shares follow the selected hierarchy.
- % Of compares with a base item and can exceed 100%.
- Filters can change the denominator even when a cell amount stays the same.
5.2 Compare periods, accumulate and rank
A comparison needs both an amount and a base. Show Values As can subtract a base item, accumulate amounts along an ordered field, rank items or compare a cell with its row-and-column pattern.
Compare one period with another
Keep Months in Rows in calendar order. For Jan 620, Feb 670 and Mar 820, Difference From with base field Months and base item "(previous)" gives a blank for Jan, 50 for Feb and 150 for Mar. A fixed base item Jan instead gives Mar 200. "(next)" compares with the following displayed item.
% Difference From divides the change by the base value:
With the previous month as base, February's increase is 50 divided by 620, or 8.06%. March's increase is 150 divided by 670, or 22.39%. Against January, March is up 200 divided by 620, or 32.26%. % Of would show the ratio to the base, not the increase from it.
The first item in a previous-item comparison has no earlier item, so it stays blank. Keep the base field in the layout; otherwise these comparisons can show #N/A. Set the base item from the wording of the question, not from the first item you happen to see.
Accumulate in a meaningful order
Running Total In Months gives Jan 620, Feb 1,290 and Mar 2,110. February's result includes both January and February. % Running Total In expresses the same progress as a share of the period total: 29.38%, 61.14% and 100.00%.
With Region above Months, a running total restarts within each region. North reaches 320, 420 and 750; South reaches 300, 870 and 1,360. The final cumulative result in each region equals that region's total.
These displays follow item order. Sorting the months by revenue changes the accumulation sequence and the meaning of "previous". Keep periods in calendar order for time comparisons. Show the plain monthly figure beside the cumulative result so readers can distinguish the month's activity from progress to date.
Rank items and inspect the mix
Rank Largest to Smallest gives the largest value rank 1; Rank Smallest to Largest gives rank 1 to the smallest. Choose the field whose items should be compared. With Region above Product and base field Product, North ranks Tea first and Coffee second, while South ranks Coffee first and Tea second. Equal values share a rank.
Index compares a cell with the amount predicted by its row and column totals:
For North–Tea, multiply 450 by 2,110 to get 949,500. The row total 750 times the Tea total 850 is 637,500. Dividing gives about 1.49. Tea is more concentrated in North than the overall product mix would predict. North–Coffee's index is about 0.67. An index of 1 matches that proportional mix; it is not a revenue amount or a percentage share.
Key Takeaways
- A previous-item comparison uses the previous displayed item.
- % Difference From divides the change by its base value.
- A running total accumulates in item order and restarts within outer groups.
- Rank 1 belongs to the largest or smallest value according to the chosen direction.
- Index compares a cell with the proportional row-and-column expectation.
- Keep the base field visible and time periods in calendar order.
5.3 Add calculated fields
A calculated field adds a measure made from existing fields. Its formula runs on the summed values for each report cell.
Create a ratio of totals
Select PivotTable Analyze > Fields, Items & Sets > Calculated Field. Name it "Price per unit" and enter =Revenue/Units. Insert Field places the field names correctly. Add the new field to Values and set its number format.
North–Tea has revenue 450 and units 90, so the field shows 5.00. The Grand Total has revenue 2,110 and units 275, so it shows 7.67. Excel evaluates the ratio again using the totals. It does not add or average the displayed cell ratios. The same approach works for a margin such as =Profit/Revenue.
Put row products in the source
Suppose each order also stores Price. Three North–Tea orders each have unit price 5 and together sell 90 units. A calculated field =Price*Units multiplies Sum of Price, 15, by Sum of Units, 90. It gives 1,350 instead of the true revenue 450.
Across all ten orders, that mistaken field gives 85 times 275, or 23,375, instead of 2,110. Create a Revenue helper column that multiplies Price by Units on each source row, then summarize Revenue by Sum.
Test the grand total of a condition
The field =IF(Revenue>800, Revenue*0.05, 0) gives North 0 from revenue 750 and South 68 from revenue 1,360. At the Grand Total, Excel tests revenue 2,110 and gives 105.50. It does not add the two displayed regional bonuses.
If the intended rule is a bonus on each qualifying region's total, calculate beside the regional figures and add those bonuses, or use a source with one row per region. Putting the formula on every order is a different rule: each order is below 800, so that helper column would total zero.
Use supported formulas and handle errors
Calculated-field formulas use field names, constants, operators and suitable worksheet functions such as IF and ROUND. They cannot use cell references, defined names, array functions or a reference to Grand Total. Field names with spaces take single quotes, as in ='Net revenue'/Units.
A zero denominator produces #DIV/0!. =IF(Units=0, 0, Revenue/Units) returns zero for that case. Alternatively, PivotTable Options > Layout & Format > For error values show can display errors as blanks.
Calculated fields belong to the PivotCache and are available to reports sharing it. Reopen the dialog and select a name to edit or delete it. Data Model PivotTables use DAX measures instead; OLAP-connected reports use the cube's supported calculations.
A calculated item adds an item within a field, such as "All drinks" = Tea + Coffee. Its results also enter subtotals and grand totals, so displaying it beside Tea and Coffee counts their revenue twice. In Google Sheets, use Add > Calculated field under Values; quote field names containing spaces.
Key Takeaways
- Calculated fields evaluate formulas on summed fields in every cell and total.
- A ratio of totals can give a meaningful overall rate.
- Calculate row-by-row products in a source helper column before summing.
- A conditional grand total reruns the condition on the grand totals.
- Calculated fields cannot reference worksheet cells or Grand Total.
- A calculated item enters totals alongside the original items.
- Data Model and OLAP reports use other calculation systems.
Summarizing Data with PivotTables examples
1Build a report you can refresh
14 steps
- 1IntroductionStart with a question
You need to report revenue by region and product. The list contains Date, Region, Product, Units and Revenue, with one order on each row.
A PivotTable will collect matching orders and add their revenue. First make the source trustworthy, then choose the layout. Finally, change one source record and follow it through refresh so you can see why a report may display an older result.
- 2ExplanationMake the rows comparable
Every source row must represent the same kind of record: here, one order. Give each column one distinct, nonblank header. Keep merged headings, completely blank dividing rows and typed totals outside the selected records.
A total row is especially easy to miss because it looks useful. Excel treats it as another record, so including it adds the orders’ revenue a second time.
- 3ExampleCheck values before labels
Inspect Revenue for numbers stored as text and Date for text that only looks like a date. Convert those entries in the source before building the report.
Then check categories. "North" and "North " are different labels because of the final space. TRIM can remove extra spaces. A true blank and a numeric zero have different meanings, so replace a blank only when the missing value is known.
- 4ChallengeSpot the doubled source
Your order records sum to 980, but the source also includes a final "Total" record of 980. What total will Sum of Revenue produce, and what should you change?
---reveal---
It produces 1,960 because both the detail records and their total are added. Exclude the typed summary row from the source records. Changing its label or applying bold formatting would leave it included.
- 5TipUse a named table
Click inside the cleaned list, press Ctrl+T and confirm the headers. Name the table "tblSales" on Table Design.
A report built from this table reads added table rows at its next refresh. If the list instead has separate Jan, Feb and Mar columns, reshape it into a Month field and a Revenue field when you need one month selector. Each month then becomes records in the same source structure.
- 6ExampleInsert the empty report
Choose Insert > PivotTable from the source table. Check that the source is "tblSales", select a new worksheet and click OK.
The Fields pane lists the source headers. Its four areas control the view: Rows and Columns supply categories, Values supplies summaries, and Filters restricts the report. Dragging fields changes the summary layout while leaving the original order records intact.
- 7ExamplePlace the categories and measure
Drag Region to Rows, Product to Columns and Revenue to Values. Confirm that the value field is Sum of Revenue.
North shows Tea 450 and Coffee 300, totaling 750. South shows Tea 400 and Coffee 960, totaling 1,360. The overall total is 2,110. The North–Tea cell combines three orders: 200, 100 and 150. Its value is a group summary, not an individual order.
- 8Key InsightChange the main grouping
Move Product from Columns into Rows below Region. Products now sit inside each region. Switch their order to make Product the outer field and list regions inside each product.
The same records still contribute to each region-product combination. What changes is the hierarchy and its subtotals. If you need Units beside Revenue, add it to Values; move "Σ Values" to Rows if stacked measures read better.
- 9ChallengeInvestigate a result
The Coffee total is unexpectedly high. How can you see its contributing orders, and will edits on that extracted sheet correct the report?
---reveal---
Double-click the Coffee total to use Show Details. Excel creates a new sheet with copies of its contributing records. Editing that sheet does not update the report; make corrections in the original source and then refresh the PivotTable.
- 10ExampleFollow one correction
Return to the source and change the North–Tea order of 200 to 260. The correct North–Tea sum is now 510. With Auto Refresh off, the report can still show 450 because it reads the PivotCache, its stored data copy.
Right-click the report and choose Refresh, or press Alt+F5. Excel rereads the source into the cache, and the cell changes to 510. The layout stays in place.
- 11TipCheck the range as well as the refresh
Refresh updates the assigned source; it does not automatically extend a fixed range. If the report uses A1:E11 and new orders are below it, choose Change Data Source to include them.
A named Excel table avoids that repeated range edit when records are added to the table. Leave clear cells around the output so that new products or dates can appear without blocking the report’s growth.
- 12ChallengeFind the missing records
A report uses A1:E16. You add two records in rows 17–18 and refresh, but the total stays the same. What should you do?
---reveal---
Extend the source to A1:E18 with Change Data Source and refresh again. The refresh command did run, but it reread a source that excluded the additions. For ongoing additions, base the report on an Excel table so its source can expand with the records.
- 13ChallengeSeparate two possible causes
After a new product is entered, its row is absent from the report. Auto Refresh is off. What two source checks should come before rebuilding the report?
---reveal---
Check that the new record belongs to the assigned table or range, then refresh the PivotTable. An excluded row needs a source change; an included row needs the cache updated. If both are correct, inspect active item filters that could hide the product.
- 14RecapUse three checks before sharing
Check the records: headers, types, labels and source boundaries. Check the view: categories in Rows or Columns, the intended measure in Values, and the required filters. Check the update: refresh after source changes and allow room for new output.
When a value needs investigation, open its contributing records with Show Details, make any correction in the original source, and refresh the report.
2Choose a calculation and make it readable
11 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionAsk what the number means
- 2ExplanationMatch the function to the job
- 3ExampleSeparate missing from zero
- 4ExampleRebuild the overall average
- 5ChallengeChoose a reliable count
- 6ConnectionRead a rate’s denominator
- 7ExplanationExpose the row hierarchy
- 8TipAttach the format to the measure
- 9ChallengeDistinguish gaps from records
- 10ChallengeExplain the surprising total
- 11RecapRead measure, base and display
3Group detail without losing the boundaries
12 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionChoose the scale of the report
- 2ExampleTurn dates into months
- 3Key InsightKeep the year attached
- 4ChallengeSeparate two Januaries
- 5ExampleAnchor a seven-day group
- 6TipFix the source if grouping fails
- 7ExampleCount orders in amount bands
- 8Key InsightPlace the boundary value
- 9ChallengePredict two counts
- 10ExplanationKeep a category useful as products change
- 11ChallengeChoose what belongs in the source
- 12RecapCheck what each group includes
4Filter the view and read its total
13 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionMake the selection visible
- 2ExampleLimit the report to one region
- 3ExplanationChoose a label rule or a value rule
- 4ExampleKeep the largest customer totals
- 5Key InsightFollow the changing whole
- 6ChallengeTest the account, not the invoice
- 7ExampleAdd a visible field selection
- 8TipConnect only compatible reports
- 9ExampleSelect a date span
- 10ChallengeKeep two separated months
- 11ChallengeDiagnose an unexpectedly small total
- 12ConnectionUse the same logic in Sheets
- 13RecapQuote the figure with its selection
5Compare values and test formulas at totals
19 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionStart from the comparison question
- 2ExplanationKeep the original measure beside the display
- 3ExampleChoose what makes 100 percent
- 4ExampleCalculate the three shares
- 5ChallengeMatch the manager’s question
- 6ConnectionCompare a parent with a fixed base
- 7ExampleFind the change from the previous month
- 8ExamplePut the change over its starting value
- 9ExampleAccumulate months in order
- 10ChallengeDistinguish activity from progress
- 11Key InsightRank without changing the source
- 12ExampleCompare a cell with the expected mix
- 13ExampleCreate a price-per-unit field
- 14ExampleSee why a product needs row-level calculation
- 15ChallengePredict a ratio at the grand total
- 16ExampleTest a condition again at the total
- 17TipUse the formula’s supported inputs
- 18ChallengeBuild the report at the right level
- 19RecapName the base and the calculation level
Summarizing Data with PivotTables practice questions
Set 1: Build a reliable report10 Practice Questions
Question 1 of 10
Show answerHide answer
Question 2 of 10
Show answerHide answer
Question 3 of 10
Show answerHide answer
Question 4 of 10
Show answerHide answer
Question 5 of 10
Show answerHide answer
Question 6 of 10
Show answerHide answer
Question 7 of 10
Show answerHide answer
Question 8 of 10
Show answerHide answer
Question 9 of 10
Show answerHide answer
Question 10 of 10
Show answerHide answer
Set 2: Group and filter the right records10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 3: Choose meaningful comparisons10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
=Price*Units. What value does it show for their combined cell?Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
=IF(Revenue>1000, Revenue*0.1, 0). What pair describes the West result and the grand total?Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 4: Diagnose reports that look wrong10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 5: Check the meaning behind the numbers10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
=Revenue/Units. What should the overall field show, rounded to two decimals?Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Stuck on your own question? Homework Help
Key Terms
A
Allow multiple filters per field
Auto Refresh
Average
B
Base field
Base item
Bin
C
Calculated field
Calculated item
Calendar quarter
Change Data Source
Clear Filter
Columns area
Compact form
Count
Count Numbers
D
Date grouping
DAX measure
Difference From
Distinct Count
Division by zero
E
Excel table
F
Field
Filters area
Fiscal period
Fixed source range
Frequency
G
Grand total
H
Helper column
I
Index
Item-list filter
L
Label filter
Long layout
M
Manual group
Max
Min
Multi-Select
N
Number Format
O
Outer field
Outline form
P
Parent total
PivotCache
PivotTable
Product
R
Range width
Rank
Ratio of totals
Record
Refresh
Report Connections
Report filter
Rows area
Running Total In
S
Sample summary
Show Details
Show Values As
Slicer
Starting at
Subtotal
Sum
T
Tabular form
Timeline
Top 10 filter
U
Ungroup
V
Value filter
Values area
W
Weighted rate
#
% Difference From
% Of
% of Column Total
% of Grand Total
% of Row Total
% Running Total In
- 1Power Query
- 2Summarizing Data with PivotTables
- 3PivotCharts and Dashboards
- 4Data Models and Power Pivot
- 5What-If Analysis
- 6Descriptive Statistics and Forecasting
- 7Automating Work with Macros
About this lesson
Make your own Study Materials
Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.