Excel Slicers: Click-to-Filter Buttons for Tables and Pivot Tables

 

Excel Slicers: Click-to-Filter Buttons for Tables and Pivot Tables

A slicer is a set of clickable buttons that filters a pivot table or an Excel Table. To add one, click inside the table or pivot table, then choose Insert > Slicer (or Table Design > Insert Slicer for tables), tick the column you want to filter by, and click OK. Clicking a button filters the data instantly, and the highlighted buttons show you exactly which filters are switched on.

I started using slicers after a meeting where the numbers on my report didn't match anyone else's. The cause was embarrassingly simple. I'd used the filter dropdown on a column earlier that morning, left it set to one region, and forgot about it. The little funnel icon in the column header is easy to miss, and nothing else on the sheet tells you a filter is active. With slicers, the selected buttons are highlighted right on the sheet, so a filter I've forgotten about is much harder to overlook. I still make the odd slip, but it's a lot rarer.

How do I add a slicer to an Excel Table?

  1. Click any cell inside your Table (if your data isn't a Table yet, press Ctrl+T first)
  2. Go to Table Design > Insert Slicer
  3. Tick the column or columns you want to filter by, such as Region
  4. Click OK

A box of buttons appears on the sheet, one for each distinct value in that column. Click a button to filter the Table to that value. Slicers for Tables were added in Excel 2013, so they're not available in earlier versions.

If you've read my post on "Excel Tables", this is one more reason to turn your data into a Table before you start: the slicer option appears automatically, and new rows are included without any extra work.



How do I add a slicer to a pivot table?

  1. Click anywhere inside the pivot table
  2. Go to PivotTable Analyze > Insert Slicer
  3. Tick one or more fields, for example Region or Product
  4. Click OK

The slicer controls the pivot table in the same way a filter would, without needing the Filters box or dropdown arrows. If you're newer to pivot tables, my post on "how to make a pivot table" covers building the pivot table itself before you add a slicer.

How do I select more than one button, or clear the filter?

  • Ctrl+click buttons to select several at once, or click the multi-select button at the top of the slicer
  • Click the small funnel icon with a red cross at the top-right of the slicer to clear the filter and show everything again
  • Click a button once more while holding Ctrl to deselect it

The clear button is worth showing to anyone else who uses the file. It's the one control people tend not to notice.

Can one slicer control several pivot tables at once?

Yes, and this is where slicers become much more useful for dashboards. One slicer can filter several pivot tables together, as long as they share the same data source.

  1. Click the slicer
  2. Go to Slicer (the ribbon tab that appears) > Report Connections
  3. Tick each pivot table you want the slicer to control
  4. Click OK

If a pivot table doesn't show up in the list, it's usually not sharing the same underlying data. The easiest way to avoid this is to build your first pivot table, then copy and paste it to create the others and change the fields in each, rather than building each one from scratch.

What's a timeline, and when should I use it instead?

A timeline is a slicer designed for dates. Instead of a button for every individual date, it shows a scrollable bar that you can switch between days, months, quarters or years.

  1. Click inside the pivot table
  2. Go to PivotTable Analyze > Insert Timeline
  3. Tick your date field and click OK
  4. Use the dropdown at the top-right of the timeline to switch between Days, Months, Quarters and Years, then click and drag across the bar to select a range

The date field has to contain real dates, not text that looks like dates. If a date field doesn't appear in the list, check the column's formatting first. If you've read my post on "cleaning messy data" , text-formatted dates are exactly the kind of problem that causes this.



Why can't I see the Insert Slicer button?

A few common reasons:

  1. The data isn't a Table or pivot table. The button is greyed out on a plain range of cells. Press Ctrl+T to convert it to a Table.
  2. The file is in compatibility mode. If the title bar says "Compatibility Mode," the file is probably an old .xls file. Save it as .xlsx and reopen it.
  3. You're on an older Excel version. Slicers for pivot tables arrived in Excel 2010, and slicers for Tables in Excel 2013.
  4. The sheet is protected. Protected sheets can block inserting objects such as slicers.

How do I make a slicer look tidier?

Click the slicer and use the Slicer tab to change the style and the number of columns, which lets long lists of buttons sit side by side instead of in one tall stack. You can also rename the caption at the top, such as changing "Region" to "Choose a region", and resize or drag the slicer wherever you like on the sheet.

If a slicer lists items with no matching data, right-click it, choose Slicer Settings, and tick Hide items with no data so the list only shows values that actually exist for the current selection.

FAQ

Do slicers work with charts? Yes. A slicer connected to a pivot table also filters any pivot chart built from it, so one click updates both the table and the chart. If you've read my post on "choosing the right chart type", a slicer paired with a clean column chart makes a simple, interactive report.

Can I use a slicer on a plain range without converting it to a Table? Not directly. Slicers need a Table or a pivot table behind them, so convert the range with Ctrl+T first.

Do slicers make my file bigger or slower? Slicers themselves are light. Very large pivot tables with many slicers connected can recalculate more slowly, but for everyday workbooks you're unlikely to notice.

Will my slicers work if I send the file to someone? They'll work if the other person has Excel 2013 or later, since slicers are part of the file. They won't work properly in very old versions, and Excel for the web has some limits on creating or editing them, so it's worth testing before relying on it for a presentation.

How do I remove a slicer? Click the slicer and press Delete, or right-click it and choose Remove. Removing it doesn't change your data, it only removes the control.

Comments

Popular posts from this blog

How to Record a Macro in Excel (No Coding Needed)

Excel Charts: How to Choose the Right Chart Type

Flash Fill in Excel: How Ctrl+E Splits and Combines Text Automatically