FILTER may be the best function inside Excel. A simple condition can turn a whole table into a dynamic report, but that is only the beginning. Add a few other functions and you can build partial-text searches, slicer-controlled results, user-selected columns, and dependent drop-down lists.
The trick is understanding what FILTER really needs: a series of TRUE and FALSE values telling it which records to return. Once that clicks, the more advanced techniques become much easier.
The examples below use a property table. To keep the formulas consistent, we will call it Properties, with columns including Property, Type, and Annual Rent. Replace these names with the table and column names in your workbook.
What You'll Learn
- Build FILTER criteria with logical comparisons, partial-text searches, list membership, and row visibility.
- Combine conditions with multiplication for AND logic and addition for OR logic.
- Use CHOOSECOLS and MATCH to let users select and reorder output columns.
- Create dependent drop-down lists by referencing FILTER results with the spill operator.
1. Understand FILTER’s Most Important Argument
FILTER has three arguments:
=FILTER(array,include,[if_empty])
- array: The data you want to return.
- include: The condition that decides which records to keep.
- if_empty: The value to display when nothing matches.
The second argument is where the interesting work happens. Before building the whole formula, try entering just the condition:
=Properties[Type]=I4
If cell I4 contains Commercial, Excel compares every item in the Type column with that value. Matching rows return TRUE; everything else returns FALSE.
Now put that condition inside FILTER:
=FILTER(Properties,Properties[Type]=I4,"No values")
The first argument supplies the entire table. The second supplies the TRUE or FALSE result for each row. FILTER returns only the rows marked TRUE.
Change I4 to Residential and the result updates. Enter a type that does not exist and the formula returns No values.
That is the foundation for everything that follows: build the right include argument, and FILTER does the rest.
2. Filter with Multiple Conditions Using AND and OR
What if you want commercial properties with annual rent above 5,000? You need two conditions, combined into one include argument.
Multiply conditions for AND
Wrap each comparison in parentheses and multiply them:
=FILTER(
Properties,
(Properties[Type]="Commercial")*(Properties[Annual Rent]>5000),
"No values"
)
Multiplication converts the logical results into ones and zeros. A row gets a 1 only when both comparisons are TRUE. If either comparison is FALSE, the result is 0.
FILTER therefore returns only properties that are commercial and have annual rent greater than 5,000.
Add conditions for OR
For an OR condition, replace the multiplication symbol with a plus sign:
=FILTER(
Properties,
(Properties[Type]="Commercial")+(Properties[Annual Rent]>5000),
"No values"
)
This returns properties that are commercial or have annual rent greater than 5,000. Rows meeting both conditions are included too.
The rule is simple:
- AND: Multiply conditions with
*. - OR: Add conditions with
+. - In both cases: Put each comparison in its own parentheses.
3. Return an Entire Fallback Row When Nothing Matches
If FILTER finds no matching records and you omit its final argument, Excel returns a #CALC! error.
A text fallback such as "No values" avoids that error, but it produces just one result cell. What if your output has five columns and you want a meaningful value under every heading?
Use an array constant for the if_empty argument:
=FILTER(
Properties,
Properties[Type]=I4,
{"No values","N/A","N/A",0,0}
)
When nothing matches, the result is a single row containing:
No valuesin the first column.N/Ain the second and third columns.0in the fourth and fifth columns.
The curly brackets create the array, and the commas separate its columns. Match the fallback values to the structure of your own output.
4. Filter by a Partial Text Match
A direct equality comparison in FILTER does not give you wildcard matching. However, you can still return records containing part of a text string by combining SEARCH and ISNUMBER.
Suppose I4 contains Road, and you want every property address containing that text. Start with:
=SEARCH(I4,Properties[Property])
SEARCH returns the starting position of the text when it finds a match. For example, in 7 Bridge Road, Road begins at character 10, so the result is 10. When SEARCH cannot find the text, it returns an error.
We do not need the position itself. We just need to know whether SEARCH found a number. Wrap it in ISNUMBER:
=ISNUMBER(SEARCH(I4,Properties[Property]))
Now matching addresses return TRUE, and nonmatching addresses return FALSE. That is exactly what FILTER needs:
=FILTER(
Properties,
ISNUMBER(SEARCH(I4,Properties[Property])),
"No values"
)
Enter Road to return matching road addresses. Change it to Street and the result updates. If you enter Avenue and there are no matching addresses, the fallback message appears.
5. Filter Based on Another List
Sometimes your criteria are not a single value. You have a separate list of properties, and you want all source records whose property names appear in that list.
For this example, let SelectedProperties refer to the range containing that list. Use COUNTIFS to test each property name against it:
=COUNTIFS(SelectedProperties,Properties[Property])
If a property appears once in the selection list, COUNTIFS returns 1. If it does not appear, the result is 0. Those numbers work as the include argument:
=FILTER(
Properties,
COUNTIFS(SelectedProperties,Properties[Property]),
"No values"
)
For example, Main Street is returned when it appears in the selection list. If 23 Park Lane is absent, that property is excluded. Add it to the referenced list and its matching record appears in the filtered result.
Again, the important part is not how complicated the selection seems. It is simply finding a formula that produces a nonzero result for the rows you want and zero for the rows you do not.
6. Control FILTER Results with Slicers
Slicers provide a convenient way to filter an Excel table. With the right formula, you can also use those selections to control a separate FILTER result.
Add slicers to the source table
- Select a cell inside the property table.
- Go to Insert > Slicer.
- Select the Property and Type columns.
- Click OK.
The slicers now control which source-table rows are visible. The next step is to translate that visibility into ones and zeros.
Test visibility with BYROW, LAMBDA, and SUBTOTAL
=BYROW(
Properties[Property],
LAMBDA(r,SUBTOTAL(3,r))
)
Here is how the pieces fit together:
- BYROW applies a calculation to each row in the Property column.
- LAMBDA defines that calculation, with
rrepresenting the current row reference. - SUBTOTAL uses function number
3, COUNTA, to count a nonempty property cell when its row is visible.
For the populated Property column, visible rows return 1 and rows hidden by the slicer return 0.
Use that visibility test inside FILTER:
=FILTER(
Properties,
BYROW(Properties[Property],LAMBDA(r,SUBTOTAL(3,r))),
"No values"
)
Now the slicers control both the source-table visibility and the records returned by the formula.
This works best when the source table and the FILTER output are on different worksheet tabs. That keeps filtering the source rows from interfering with the display of your result.
7. Add a Show All Items Option
A filter normally narrows the data down. But it is often useful to give the user a way to return everything as well.
We can use an asterisk in I4 as our Show All option. First, create an include array containing a 1 for every source row:
=SEQUENCE(ROWS(Properties[Property]),1,1,0)
The SEQUENCE arguments specify:
- Rows: The number of rows in the property table.
- Columns: One column.
- Start: Begin at 1.
- Step: Increase by 0, so every result remains 1.
Because every row gets a 1, every row will be included.
Next, use IF to switch between that all-ones array and the normal Type comparison:
=FILTER(
Properties,
IF(
I4="*",
SEQUENCE(ROWS(Properties[Property]),1,1,0),
Properties[Type]=I4
),
"No values"
)
Enter Commercial or Residential to filter by type. Enter * to return the whole table.
The asterisk is not acting as a wildcard here. It is simply a value we have explicitly told IF to recognize as the instruction to include everything.
8. Return Specific Columns in Any Order
FILTER returns the columns supplied in its first argument. If you give it the whole table, it returns the whole table structure.
To return only certain columns, use CHOOSECOLS. Suppose Property is column 1, Annual Rent is column 5, and Type is column 3:
=CHOOSECOLS(Properties,1,5,3)
This returns those three columns in the specified order: Property, Annual Rent, then Type.
Use that expression as FILTER’s first argument:
=FILTER(
CHOOSECOLS(Properties,1,5,3),
Properties[Type]=I4,
"No values"
)
The include argument still checks the source Type column, but the output contains only the three selected columns.
CHOOSECOLS also accepts the column numbers as an array constant:
=FILTER(
CHOOSECOLS(Properties,{1,5,3}),
Properties[Type]=I4,
"No values"
)
Both versions produce the same result. You can select the columns you need and change their order without rearranging the source table.
9. Let the User Choose Which Columns to Display
Hardcoded column numbers are useful, but we can go further. What if the user should decide which columns appear in the result?
Set up three cells containing the desired column headings. For this example, use I7:K7, with data validation lists so users can choose from the source-table headings.
MATCH converts those selected headings into column positions:
=MATCH(I7:K7,Properties[#Headers],0)
The final argument, 0, requests exact matches. If the selected headings are Property, Annual Rent, and Type, MATCH returns the array {1,5,3}.
That is the same array we supplied manually in the previous example. Replace the fixed column numbers with MATCH:
=FILTER(
CHOOSECOLS(
Properties,
MATCH(I7:K7,Properties[#Headers],0)
),
Properties[Type]=I4,
"No values"
)
Now changing a heading selection changes the corresponding output column. The user controls both which fields appear and the order in which they appear, while the underlying FILTER condition continues to select the matching records.
10. Create a Dynamic Dependent Drop-Down List
FILTER can also provide the items for a dependent data validation list.
Suppose I4 already contains a drop-down with Commercial and Residential. You want the drop-down in I5 to offer only properties belonging to the selected type.
Create the filtered helper list
In cell O4, enter:
=FILTER(
Properties[Property],
Properties[Type]=I4,
"No values"
)
This time, FILTER returns only the Property column rather than the entire table. Changing the type in I4 changes the property list spilling from O4.
Use the spill range as the validation source
- Select cell
I5. - Go to Data > Data Validation.
- Set Allow to List.
- Enter
=$O$4#in the Source box. - Click OK.
The hash symbol refers to the entire spill range starting at O4, rather than a fixed number of cells.
Select Residential in the first drop-down and the second drop-down offers residential properties. Select Commercial and it offers commercial properties instead. The dependent list follows the FILTER result.
The Real FILTER Trick: Think in TRUE and FALSE
These techniques all share the same foundation. A comparison, a text search, a count against another list, or a visibility calculation creates the include argument. FILTER then returns the records that pass that test.
CHOOSECOLS lets you shape the output, MATCH hands column selection to the user, and spill references connect the result to data validation. Together, they turn a simple filtering formula into a much more flexible spreadsheet.
The goal is less manual work and better systems. Once you start thinking in TRUE and FALSE arrays, you are well on your way to becoming a FILTER function ninja.


