To filter and extract data based on multiple complex criteria, you can use the FILTER function with a chain of expressions that use boolean logic. In the example shown, the formula in G5 is:


This formula returns data where:

account begins with "x" AND region is "east", and month is NOT April.


In this example, we need to construct logic that filters data to include:

account begins with "x" AND region is "east", and month is NOT April.

The filtering logic of this formula (the include argument) is created by chaining together three expressions that use boolean logic on arrays in the data. The first expression uses the LEFT function to test if Account begins with "x":

LEFT(B5:B16)="x" // account begins with "x"

The result is an array of TRUE FALSE values like this:


The second expression tests if Region is "east" with the equal to (=) operator:

C5:C16="east" // region is east

The result is another array:


The third expression uses the MONTH function with the NOT function to test if the month is not April:

NOT(MONTH(D5:D16)=4) // month is not april

which yields:


Note that the NOT function reverses the result from the MONTH expression.

All three arrays are multiplied together. The math operation coerces the TRUE and FALSE values to 1s and 0s, so at this point we can visualize the include argument like this:


Boolean multiplication corresponds to the logical function AND, so the final result is a single array like this:


The FILTER function uses this array to filter the data, and returns the four rows that correspond with the 1s in the array.

Extending criteria

The expressions used to create the include argument in filter can be extended as needed to handle even more complex filters. For example, to further filter data to include only rows where amount > 10000, you could use a formula like this:

Dave Bruns Profile Picture

AuthorMicrosoft Most Valuable Professional Award

Dave Bruns

Hi - I'm Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.