Slicers are an excellent way to add interactivity to an Excel report. Click a button, select the items you want, and the results update to match.
They work with PivotTables, PivotCharts, CUBE functions, and Excel Tables. But standard formulas do not have a direct connection to a slicer. So how do we make a formula-based report respond to slicer selections?
The trick is to use an Excel Table as the link between the slicer and our formulas. We can identify which rows the slicer leaves visible, return those items with FILTER, and use the results in our calculations.
There are two ways to do this: a simple helper-column method using SUBTOTAL, and an alternative using BYROW and LAMBDA that avoids the extra column.
Set Up the Actual and Budget Report
For this example, we have two separate data tables: one containing actual values and another containing budget values. We want a report showing the selected items, their actual totals, their budget totals, and the variance between the two.
We could combine the data into a single table and use a PivotTable. We could also bring both tables into the Data Model. But neither is necessary here. We want to leave the two source tables as they are and build the report with formulas.
Alongside those source tables, we need a small Excel Table containing all possible item names. In this example, the items run from Alpha through Hotel.
To make the formulas easy to follow, we will use these table names:
- tblList: The selection table, with a column called List.
- tblActual: The actual data, including Item and Value columns.
- tblBudget: The budget data, also including Item and Value columns.
Use your own table names if they are different, and adjust the structured references accordingly.
The report uses dynamic arrays, so you will need an Excel version that supports FILTER and spill ranges. The second method also requires BYROW and LAMBDA.
Create the Slicer
- Click a cell in the item-list table.
- Go to Insert > Slicer.
- Select the List field and click OK.
- If the report is on another worksheet, select the slicer, press Ctrl+X, move to the report sheet, and press Ctrl+V.
The slicer is now connected to the item-list table. Selecting Echo, for example, filters that table to Echo. Selecting Charlie and Delta leaves those two items visible.
At this stage, the slicer does not control our report calculations. It only filters the list. Our next job is to turn that filtered state into values that formulas can use.
Method 1: Use SUBTOTAL in a Helper Column
Add an Include column
Add a column called Include to tblList. In its first data row, enter:
=SUBTOTAL(103,[@List])
Because this is an Excel Table, the formula fills down the column.
SUBTOTAL can perform several calculations, depending on its first argument. Here, 103 selects COUNTA and ignores hidden rows. Applied to a single nonblank item cell, it gives us exactly the flag we need:
- 1: The item is visible.
- 0: The item is filtered out.
There is a useful distinction between the SUBTOTAL function numbers. Both the 1 through 11 group and the 101 through 111 group exclude filtered-out rows. The 101 through 111 group also excludes manually hidden rows. That is why 103 works well for this helper column.
Check the visibility flags
Select two items in the slicer. The list table now shows only those two rows, each with an Include value of 1. The other rows still exist, but their Include formulas return 0.
To confirm that, enter this formula in a spare cell:
=SUM(tblList[Include])
With two items selected, the result is 2. This is an ordinary SUM calculation over the entire Include column. It returns 2 because the filtered-out rows contribute zeros.
We now have a way for standard formulas to read the slicer selection.
Return the Selected Items with FILTER
On the report sheet, add these headings across cells C4:F4:
- C4: Slicer Selected
- D4: Actual
- E4: Budget
- F4: Variance
In C5, enter:
=FILTER(tblList[List],tblList[Include]=1,"No values")
The formula returns the List entries where Include equals 1. If no entries meet the condition, it returns the text No values.
Select Alpha and Bravo in the slicer, and those two names spill down from C5. Select additional items, and the result expands to include them.
The slicer is now controlling cell values. It does so indirectly: the slicer filters the table, SUBTOTAL identifies the visible rows, and FILTER returns their names.
Calculate Actual, Budget, and Variance
With the selected item names available in cells, the rest of the report is straightforward.
Actual totals
In D5, enter:
=SUMIFS(tblActual[Value],tblActual[Item],C5#)
This sums the actual Value column for each item returned by FILTER.
The # is important. C5 refers to the first selected item, while C5# refers to the entire spilled range. Passing that range to SUMIFS returns one total for each selected item, with the results spilling down automatically.
Budget totals
In E5, enter:
=SUMIFS(tblBudget[Value],tblBudget[Item],C5#)
This uses the same selected-item list but calculates the totals from the budget table.
Variance
In F5, enter:
=D5#-E5#
Both references use the spill operator, so Excel subtracts each budget amount from its corresponding actual amount.
We now have a complete formula-based report. Changing the slicer selection changes the item list, the actual totals, the budget totals, and the variances. The two source tables remain separate throughout.
Method 2: Use BYROW and LAMBDA Without a Helper Column
The helper-column method is simple, but what if we do not want to add an Include column to the list table?
We can move the visibility calculation into the report formula using BYROW and LAMBDA. Thanks to Giancarlo for sharing this approach in a blog comment.
Build the visibility calculation
Start with this LAMBDA expression:
=LAMBDA(x,SUBTOTAL(3,x))
The parameter x represents the reference passed into the calculation. SUBTOTAL then performs COUNTA on that reference.
This time, we use function number 3. It excludes rows removed by the slicer's filter, which is what we need here, but it does not exclude manually hidden rows.
The LAMBDA expression defines the calculation. To apply it to each row of the item list, place it inside BYROW:
=BYROW(tblList[List],LAMBDA(x,SUBTOTAL(3,x)))
BYROW applies the same calculation to each row and returns a spilled array of ones and zeros.
For example, if Alpha and Hotel are selected, the first and last positions return 1. The positions for the items between them return 0. This is the same visibility information we previously stored in the Include column, but now it is calculated within a single formula.
Use the result inside FILTER
Excel treats 1 as TRUE and 0 as FALSE in FILTER's include argument. Therefore, we can use the BYROW result directly:
=FILTER(tblList[List],BYROW(tblList[List],LAMBDA(x,SUBTOTAL(3,x))))
The formula returns only the items left visible by the slicer. If you want the same empty-result message as the first method, add it as the third argument:
=FILTER(tblList[List],BYROW(tblList[List],LAMBDA(x,SUBTOTAL(3,x)))),"No values")
Place your chosen version in C5 instead of the helper-column FILTER formula. The Actual, Budget, and Variance formulas can remain unchanged because they still refer to the selected items through C5#.
Which Method Should You Use?
Both methods create the same essential connection between an Excel slicer and standard formulas.
- Use the helper-column method when you want a simple setup with visibility flags that are easy to inspect in the table.
- Use the LAMBDA method when you want to avoid an additional column and your Excel version supports BYROW and LAMBDA.
The important idea is the same in both cases: read which table rows are visible, then use those items as formula criteria. Excel does not provide that direct slicer-to-formula connection natively, but this workaround gives us an interactive report without combining the source tables or building a Data Model.


