Confident CellsExcel practice Start free

PivotTables: filters, dates and refresh: practice exercises

Filters, (Multiple Items), hiding items, grouping dates by month and quarter, number bands, Refresh, Change Data Source. 8 exercises on real-looking data, each checked as you go. The full lesson is part of Pro.

In the lesson

This lesson has a PivotTable builder like Excel's: drag fields into Rows, Columns and Values, and each task is checked as you go.

Open the PivotTables: filters, dates and refresh lesson

How it works

A field in Filters goes above the PivotTable with a list: pick one item, or several, and the PivotTable only counts those records. To leave items out of Rows instead, untick them in Row Labels ▾.

Dates in Rows or Columns are grouped by month for you. Open the field's menu, then Field Settings, to group by quarters or years instead, or to put numbers into bands such as 20-29. And a PivotTable doesn't change when its data does: press Refresh, or Change Data Source if the data has grown.

Filters

A field in the Filters box sits above the PivotTable with a ▾ list. Pick one item and the PivotTable only counts those records. Tick several and it says (Multiple Items).

Filters

Region

Columns

Rows

Product

Values

Sum of Sales (£)
RegionNorth
Row LabelsSum of Sales (£)
Laptops1350
Phones790
Grand Total2140

To leave items out of the rows themselves, open Row Labels ▾ on the sheet and untick them. The totals then leave them out too.

Grouping dates and numbers

Put a date field in Rows or Columns and Excel groups it by month for you (by year, quarter and month if the dates cover more than one year). To change it, open the field's menu, choose Field Settings, and tick Years, Quarters, Months or Days. In Excel, right-click (or Control-click) a date in the PivotTable and choose Group.

Numbers can be grouped into bands too: ages starting at 20, by 10, give 20-29, 30-39 and so on.

Row LabelsCount of Name
20-294
30-396
40-493
Grand Total13

Refresh and Change Data Source

A PivotTable works from a copy of the data taken when it was made. Change the data and the PivotTable stays as it was until you press Refresh. Moving fields around doesn't re-read the data.

Refresh reads the same range again, so rows added underneath are left out. Use Change Data Source to take them in. Better still, make the data an Excel table (Ctrl+T) before you insert the PivotTable: then Refresh always takes in the whole table, new rows and all.

What you'll practise

  1. Show the total sales of each product in the South region only. Put Region in Filters and choose South.
  2. The Region filter shows (All). Make the PivotTable count East and West together, and leave the other region out.
  3. Laptops have been discontinued. Leave Laptops out of the PivotTable, and keep every other product.
  4. Show the total sales for each month: put Date in Rows. (Excel groups the dates by month for you. Make sure it's by month.)
  5. Show total sales with regions down the side and quarters across the top (Qtr1 to Qtr4).
  6. The sale in row 5 was wrong and has just been corrected to 2390. The PivotTable still shows the old total. Bring it up to date.
  7. Two late sales were added in rows 17 and 18, after the PivotTable was made from A1:D16. Refresh alone won't bring them in. Use Change Data Source so it uses the whole table.
  8. Count the staff in each age band: Age in Rows, grouped starting at 20 in bands of 10 (20-29, 30-39 and so on), and Name in Values to count them.