Function Problems

Use Excel Filters and Slicers with the FILTER Function

Amos GikundaAmos Gikunda Dec 2, 2026 869 views

Question details

Use the FILTER function to return only source rows visible after applying an Excel worksheet filter or table slicer.

Use Excel Filters and Slicers with the FILTER Function
Product
Microsoft Excel
Device & OS
not provided
Scenario
A user wants a formula to return visible source rows that also match a city and a numeric range.
Observed behavior
The FILTER function does not automatically use worksheet filter or slicer selections as criteria.
Before you start

Check that your Excel version supports the FILTER function, such as Excel for Microsoft 365 or Excel 2021. Choose a source column that is populated in every data row for the visibility check.

Solution 1Recommended

Add a visibility helper column to the Excel source data

Use this method to combine visible-row status with other FILTER criteria.

SUBTOTAL can identify rows hidden by a worksheet filter. A table slicer also works when it filters the same source table used by the formula.

1
Add a helper column

On the 'master sheet' worksheet, add a header such as Visible in C1. In C2, enter =SUBTOTAL(103,A2) and fill the formula down through C321. Column A must contain a nonblank value in every source row.

2
Apply a filter or slicer

Select the source data and use Data > Filter, or convert it to a table with Insert > Table and choose Insert > Slicer. Use the filter arrows or slicer to select the rows to show.

3
Enter the criteria

On the output sheet, enter the city to match in F2 and the lower and upper numeric bounds in G2 and H2.

4
Filter the visible rows

In an empty cell on the output sheet, enter =FILTER('master sheet'!A2:B321,('master sheet'!A2:A321=F2)*('master sheet'!C2:C321=1)*('master sheet'!B2:B321>G2)*('master sheet'!B2:B321<H2),"No matching rows"). Adjust the ranges and criteria to match your data.

Add a visibility helper column to the Excel source data
Check the source and bounds: The example excludes values equal to G2 or H2; use >= or <= to include them. A slicer connected only to a PivotTable does not necessarily hide rows in the original source table.
Work with visible rows in WPS

Filter Visible Spreadsheet Rows in WPS Office

In a WPS Spreadsheet version that supports FILTER, use a SUBTOTAL helper column and a worksheet filter to return visible rows that meet your criteria.

  1. 1. Open the workbook: Open WPS Spreadsheet and select Open to load the Excel workbook.
  2. 2. Create the helper: On the source sheet, enter =SUBTOTAL(103,A2) in an empty helper column and fill it down. Use a source column that is nonblank in every row.
  3. 3. Filter the source: Select the source range, choose Data > Filter, and use a filter arrow to show the desired rows.
  4. 4. Return visible matches: On an output sheet, enter a FILTER formula that includes the helper range equal to 1, along with any other criteria. Confirm that your WPS version supports FILTER.
Combine visible-row status with city and numeric criteriaOpen and edit Microsoft Excel XLSX filesUse a familiar spreadsheet interfaceWork with a free Office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does FILTER return rows hidden by an Excel filter?

FILTER evaluates the criteria in its formula, not the worksheet's visible-row state. Add a SUBTOTAL helper column and include helper_range=1 in the FILTER criteria.

Can I use a slicer with the visibility helper?

Yes, if the slicer filters the same Excel table that supplies the formula. Select the table, choose Insert > Slicer, and select the field to control.

Why does the helper return 0 for a visible row?

SUBTOTAL(103,A2) counts a nonblank cell. If A2 is blank, choose another column that is populated in every source row and update the helper formula.

How can I include the endpoints of the numeric range?

In the FILTER formula, change the lower-bound comparison from >G2 to >=G2 and the upper-bound comparison from <H2 to <=H2.