where data (B5:E15) and date (C5:C15) are named ranges. The result returned by FILTER includes data in the month of July only. Here, MONTH receives the range C5:C15. Since the range contains 11 cells, MONTH returns an array with 11 results: Each result is then compared to 7, and this operation creates an array of TRUE and FALSE values, which is delivered to the FILTER function as the include argument. Only rows where the result is TRUE make it into the final output. The if_empty argument is set to “No data” in case no matching data is found.

Filter by month and year

To filter by month and year, you can construct a formula using boolean logic like this: Although the values for month and year are hardcoded above into the formula, they can easily be replaced with cell references.

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.