Excel 2024: Filter with a Formula
August 02, 2024 - by Bill Jelen
The FILTER
function is new as part of the dynamic arrays feature. There are three arguments: array, include, and an optional [if empty].
Say you want to be able to enter a team name in G1 and extract all of the records for that team. Use a formula of =FILTER(B3:E9,C3:C9=G1)
.
If cell G1 changes from Red to Blue, the results change to show you the blue team records.
In the above examples, the optional [If Empty] argument is missing. If someone is allowed to enter the wrong team name in G1, then you will get a #CALC!
error.
To avoid the #CALC!
error, add a third argument.
You can specify an array constant for the third argument if you want to fill each column of the answer array.
To filter to records where multiple conditions are met, multiply the conditions together.
Bonus Tip: Understanding Array Constants
You've just seen a few examples that included an array constant. Here is a simple way to understand them. A comma inside an array constant means to move to the next column. A semi-colon means to move to the next row. How do you remember which is which? The semi-colon on your keyboard is located near the Enter or Return key which also goes to the next row.
When you see an array constant with a mix of commas and semi-colons, remember that each semi-colon moves to a new row.
This article is an excerpt from MrExcel 2024 Igniting Excel
Title photo by Rae Wallis on Unsplash