PivotTables: slicers and timelines: practice exercises
Insert Slicer, Ctrl+click for two items, Multi-Select, Clear Filter, a slicer for a field not in the PivotTable, Insert Timeline, months and quarters. 8 exercises on real-looking data, each checked as you go. The full lesson is part of Pro.
This lesson has a PivotTable builder like Excel's: drag fields into Rows, Columns and Values, and each task is checked as you go.
How it works
A slicer is a panel of buttons that filters a PivotTable. Click Nottingham and the PivotTable shows only Nottingham; Ctrl+click Derby to add it. Everyone can see what's filtered, which a ▾ list hides.
A timeline is a slicer for dates: a strip of months (or quarters, years or days). Click a month, or drag across several, and the PivotTable counts only those dates. Both are on the PivotTable Analyse tab (Pivot Table Analyse on a Mac): Insert Slicer and Insert Timeline.
Slicers: filter buttons
Nottingham staff lost 42 days to absence this year. Click Nottingham on the Site slicer and the PivotTable shows only those 42. Ctrl+click Derby to add its 31: the Grand Total becomes 73.
| Row Labels | Sum of Days |
| HR | 21 |
| IT | 27 |
| Warehouse | 25 |
| Grand Total | 73 |
To make one: click in the PivotTable, then PivotTable Analyse > Insert Slicer, tick the field and press OK. (On a Mac the tab is called Pivot Table Analyse.) The field doesn't have to be in the PivotTable: Site isn't, here.
A slicer and the field's ▾ list are two views of one filter. Tick items in one and the other changes to match.
Several items, and clearing
- Click a button: just that item.
- Ctrl+click: add an item, or take one out. With every item selected, Ctrl+click takes that one out.
- Multi-Select (the ticks button at the top): every click adds or takes out, with no key held down. Use it on a phone or tablet.
- Clear Filter (the funnel with a cross): every item again.
A greyed-out button is an item with no records left after the other filters: no Warehouse absences at Derby, say.
Deleting a slicer does not clear its filter. Clear it first, or the PivotTable stays filtered with nothing on screen to say so.
Timelines
A timeline is a slicer for dates. PivotTable Analyse > Insert Timeline lists the fields of dates. It starts in MONTHS: change the list at its top right to QUARTERS, YEARS or DAYS.
Pick Q2 and the PivotTable counts April to June only. Click one period, then drag (or Shift+click) to pick a run of them, such as March to May. The funnel at the top right clears it.
The dates must be real dates, not text, or Excel says the PivotTable has no fields formatted as a date.
What you'll practise
- The PivotTable shows absence days for each department, across every site. Insert a slicer for Site, then use it to show Lincoln only.
- The Site slicer shows Leicester. Add Derby as well, so the PivotTable totals both sites together.
- Leave Sickness out of the totals and keep every other reason. With all the buttons selected, a plain click would pick only Sickness: turn on Multi-Select (the button with ticks at the top of the slicer), then click Sickness to take it out.
- The PivotTable shows days lost to each reason. Insert two slicers, for Site and Department, and use them to show only Customer service at Lincoln.
- The report should cover every site again, and the slicer isn't wanted any more. Clear its filter (the funnel with a cross, top right), then delete the slicer (the ×).
- Insert a timeline for Date, then use it to show the absences in October only.
- Show quarter 3 only (July to September). Change the timeline from MONTHS to QUARTERS (the list at its top right), then pick Q3.
- How many days did Leicester lose from March to May? Use a slicer for Site and a timeline for Date to find out, and leave them set. Then type the number in B23.