Sub topic 9
Filter visually with slicers
Slicers are clickable buttons that filter a Table, a PivotTable, or a Table-based data model. This chapter assumes you can already turn a range into an Excel Table, apply AutoFilter conditions, and read a filtered list. It covers how slicers work, how to build and configure them, and the errors that come up most often.
What a slicer is
A slicer is a floating panel attached to one column of a Table. It lists each distinct value in that column as a button. Selecting a button filters the Table to the rows that have that value. A slicer does the same job as the AutoFilter drop-down on that column. The difference is that its state stays visible on the sheet. You can see at a glance which regions, years, or categories are active without opening a menu.
Slicers have three practical advantages over drop-down filters:
- The active selection is always visible, so a printed or shared sheet shows what is filtered.
- One slicer can drive several Tables or PivotTables at once.
- Buttons are easier to use than check-box lists, especially on a touch screen.
They also have limits. A slicer matches exact values only. It cannot express "greater than 500" or "begins with A". For those conditions, use the AutoFilter number and text filters covered earlier, or the Advanced Filter.
Prerequisites in your data
A slicer needs a Table. A plain range with AutoFilter turned on cannot take a slicer. If the Insert Slicer command is greyed out, the active cell is probably not inside a Table.
To convert a range, select any cell in the data and press Ctrl+T. Confirm that "My table has headers" is checked. The layout rules from the first chapter still apply. Each column needs a unique header, there should be no blank rows inside the data, and each column should hold one type of value. A slicer button is created for each distinct value, so inconsistent entries such as "West", "west ", and "W." appear as separate buttons.
Insert a slicer
- Click any cell inside the Table.
- Go to Table Design and choose Insert Slicer. You can also use Insert > Slicer.
- Tick one or more column names, then choose OK.
Excel creates one slicer for each column you ticked. Each slicer appears as a panel on top of the cells. Drag it to move it, and drag its edges to resize it.
Use a slicer
The selection rules are simple:
- Click a button to show only rows with that value. The Table filters immediately.
- Hold Ctrl and click more buttons to select several values. Hold Shift to select a continuous run.
- Click the multi-select icon at the top right of the slicer to make every click add to the selection without holding Ctrl.
- Click the funnel with a cross icon, or press Alt+C with the slicer selected, to clear that slicer's filter.
Buttons that have no matching rows, given the other active filters, turn grey. This behavior helps you see which combinations exist. A grey button is not an error.
How several slicers combine
Each slicer filters one column. When several slicers are active, Excel keeps only the rows that satisfy all of them. This is the same AND behavior as filtering several columns with AutoFilter. Within one slicer, multiple selected buttons combine with OR.
The following example shows the logic for a Table of sales rows.
| Region slicer | Product slicer | Rows shown |
|---|---|---|
| West | (no selection) | All West rows |
| West, East | (no selection) | Rows that are West or East |
| West, East | Laptop | Rows that are (West or East) and Laptop |
Configure a slicer
Select a slicer to show the Slicer tab on the ribbon. The most useful settings are these:
- Columns: arranges the buttons in several columns. A slicer with twelve month buttons is easier to scan with four columns than with one long list.
- Button size: change the height and width to fit your layout.
- Slicer Settings: sets the caption, the sort order of the buttons, and whether to hide items with no data. The sort order can be ascending, descending, or follow a custom list.
- Styles: change the color scheme to match the sheet.
- Report Connections (PivotTable slicers) or Table Connections in newer versions: choose which objects the slicer controls.
Rename the slicer in the Slicer Caption box so the sheet reads clearly. The caption is only a label. The slicer's internal name, shown on the ribbon, is separate and is what you would see in the Selection Pane.
Date columns and timelines
A slicer on a date column creates one button for each distinct date, which is rarely useful. Two better approaches exist:
- Add helper columns to the Table, such as Year and Month, with formulas like
=YEAR([@Date])and=TEXT([@Date],"yyyy-mm"). Then slice on those columns. - For PivotTables, use a Timeline (PivotTable Analyze > Insert Timeline). A timeline lets you drag across months, quarters, or years. Timelines do not work on plain Tables.
Slicers and formulas
Slicers hide rows. Formulas respond to hidden rows only when they are written to do so. A normal SUM adds every row, hidden or not, so the total will not change when you click a slicer. Use SUBTOTAL with a function number that ignores filtered rows. The following formula totals the Amount column of a Table named Sales and updates as slicers change.
=SUBTOTAL(109, Sales[Amount])Function number 109 sums only visible cells and ignores rows hidden by a filter, which includes rows hidden by a slicer. If you place the formula in a cell above or beside the Table, it stays visible when rows are filtered out.
To count visible rows, use:
=SUBTOTAL(103, Sales[Region])Function number 103 is COUNTA for visible cells.
The dynamic array functions FILTER, SORT, and UNIQUE do not react to slicers. They read the source data regardless of which rows are hidden. If you want a formula result that follows a slicer, use SUBTOTAL, or build a PivotTable and slice that instead.
Connect one slicer to several objects
A slicer can control more than one PivotTable. This is the main reason to prefer slicers on dashboards. Right-click the slicer and choose Report Connections, then tick every PivotTable that should respond. All of them must share the same data source, meaning the same cache. Pivot tables created from the same Table range with "copy and paste" of an existing PivotTable share a cache. PivotTables created separately from the same range may not, and the slicer will not list them.
Slicers on ordinary Tables cannot control other Tables. Each Table needs its own slicers.
Common problems
| Symptom | Likely cause | Fix |
|---|---|---|
| Insert Slicer is greyed out | The active cell is not in a Table, or the file is in an old format | Convert the range with Ctrl+T, and save as .xlsx |
| Totals do not change when you click | The formula uses `SUM` | Use `SUBTOTAL(109, ...)` |
| A slicer shows duplicate-looking buttons | Trailing spaces or mixed case in the data | Clean the values with `TRIM`, then refresh |
| New values are missing from the slicer | The data was added outside the Table, or a PivotTable needs a refresh | Type directly below the Table so it expands, or choose Data > Refresh All |
| Slicer does not list a PivotTable in connections | PivotTables use different caches | Recreate the second PivotTable by copying the first |
| Slicer buttons are stuck greyed out | Another slicer has excluded all matching rows | Clear the other slicers |
| The workbook is shared with someone on an old Excel version | Table slicers need Excel 2013 or later | Ask them to upgrade, or use AutoFilter instead |
A slicer is also an object that floats over cells. If you hide the rows beneath it or sort the Table, the slicer does not move. Right-click it, choose Size and Properties, and set Move and size with cells if you want it to follow the data.
When to use a slicer
Use a slicer when the people reading the sheet need to filter by a handful of categories and see what is selected. Use AutoFilter when you filter often by many different columns, or when you need a condition such as "greater than". Use FILTER when the result must be a separate live list that does not change the original data.
Exercise
A Table named Sales has columns Region, Product, and Amount. A Region slicer has West and East selected, and a Product slicer has Laptop selected. The cell F1 holds =SUM(Sales[Amount]) and shows the same total no matter which buttons you click. Which rows are shown, and what formula in F1 gives a total that follows the slicers?
Show answer
The visible rows are those where Region is West or East and Product is Laptop. Selections within one slicer combine with OR, and different slicers combine with AND. SUM adds hidden rows too, so replace the formula with =SUBTOTAL(109, Sales[Amount]), which ignores rows hidden by the slicers.
Exercise
You select a cell in a plain range with AutoFilter turned on, and the Insert Slicer command is greyed out. What is the fastest fix?
Show answer
Click a cell in the data, press Ctrl+T, and confirm that the Table has headers. The slicer command is available once the range is a Table.