Sub topic 9
Filter Visually with Slicers
Slicers are buttons that filter a Table or PivotTable. This chapter assumes you can create an Excel Table and use AutoFilter on its columns. It also assumes you know that filtering hides rows without deleting them.
What a slicer does
A slicer is a panel of buttons, one for each distinct value in a column. Clicking a button filters the Table to rows with that value. The panel stays visible on the sheet, so anyone reading the sheet can see which filter is active. A filter set through an AutoFilter drop-down is only visible when you open that menu.
Slicers use the same filtering engine as AutoFilter. Everything you learned about hidden rows still applies, including how SUBTOTAL(109, ...) ignores them.
Add a slicer to a Table
Start with a Table. The sample below has a Region column and an Amount column.
- Click any cell inside the Table.
- Go to Table Design and choose Insert Slicer.
- Tick the columns you want, for example Region, and click OK.
- Click a button in the slicer to filter the Table.
Each slicer gets its own panel. You can drag it, resize it, and change its look on the Slicer tab.
Select several values and clear the filter
- Click one button to show only that value.
- Hold Ctrl and click more buttons to add values. You can also turn on Multi-Select with the icon at the top right of the slicer.
- Drag across buttons to select a range of them.
- Click the funnel icon with the red cross, or press Alt+C, to clear the slicer's filter.
A highlighted button means that value is included. When no button is highlighted, the filter is cleared and all rows show.
Combine slicers
You can add one slicer per column. Slicers combine with AND, as filters across columns do in AutoFilter. If you select Region = West in one slicer and Product = Laptop in another, the Table shows only West laptop rows.
When you narrow one slicer, buttons in other slicers that have no matching rows turn grey. This shows which combinations produce no results. Greyed buttons can still be clicked, but they return an empty Table.
Show a live total
Place a total outside the Table, above it for example, so the filter cannot hide it:
=SUBTOTAL(109, Sales[Amount])This assumes the Table is named Sales. Each slicer click changes the result, because SUBTOTAL with function number 109 skips filtered-out rows. A plain SUM would keep returning the full total.
Common problems
| Problem | Cause | Fix |
|---|---|---|
| **Insert Slicer** is greyed out | The selected cell is not in a Table | Convert the range with **Ctrl+T** first |
| A slicer shows odd or missing buttons | The column has blanks or mixed types | Clean the column, as covered in the data preparation chapter |
| Rows stay hidden after you delete a slicer | The filter is still applied | Clear the filter with **Data > Clear** |
| Slicer covers your data | Slicers float above cells | Move it beside the Table, outside the data area |
Slicers and the sheet layout
A slicer is a floating object. Inserting rows or columns does not move it unless you set it to. Right-click the slicer, choose Size and Properties, and select Move and size with cells if it should follow the Table. When a Table grows, new rows are included in the filter automatically.
Exercise
A Table named Orders has columns Region, Product, and Amount. You add slicers for Region and Product, select West and Laptop, and the Table shows 12 rows. Write a formula to place above the Table that shows the sum of Amount for only those 12 rows, and explain why SUM would not work.
Show answer
Use =SUBTOTAL(109, Orders[Amount]). SUBTOTAL with 109 ignores rows hidden by the slicer filters, so the result matches the 12 visible rows. SUM adds every row in the Table, including hidden ones, so it would not change when the slicers change.
Exercise
You select Region = East in one slicer. In the Product slicer, the Tablet button turns grey. What does this tell you?
Show answer
No East rows have Product = Tablet. Clicking the Tablet button would show an empty Table.