Filter formula for excel

Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Excel 2021 Excel 2021 for Mac Excel 2019 Excel for iPad Excel for iPhone Excel for Android tablets Excel for Android phones More…Less

The FILTER function allows you to filter a range of data based on criteria you define.

Your browser does not support video. Install Microsoft Silverlight, Adobe Flash Player, or Internet Explorer 9.

In the following example we used the formula =FILTER(A5:D20,C5:C20=H2,»») to return all records for Apple, as selected in cell H2, and if there are no apples, return an empty string («»).

FILTER function - Filter Region by Product (Apple)

The FILTER function filters an array based on a Boolean (True/False) array.

=FILTER(array,include,[if_empty])

Argument

Description

array

Required

The array, or range to filter

include

Required

A Boolean array whose height or width is the same as the array

[if_empty]

Optional

The value to return if all values in the included array are empty (filter returns nothing)

Notes: 

  • An array can be thought of as a row of values, a column of values, or a combination of rows and columns of values. In the example above, the source array for our FILTER formula is range A5:D20.

  • The FILTER function will return an array, which will spill if it’s the final result of a formula. This means that Excel will dynamically create the appropriate sized array range when you press ENTER. If your supporting data is in an Excel table, then the array will automatically resize as you add or remove data from your array range if you’re using structured references. For more details, see this article on spilled array behavior.

  • If your dataset has the potential of returning an empty value, then use the 3rd argument ([if_empty]). Otherwise, a #CALC! error will result, as Excel does not currently support empty arrays.

  • If any value of the include argument is an error (#N/A, #VALUE, etc.) or cannot be converted to a Boolean, the FILTER function will return an error.  

  • Excel has limited support for dynamic arrays between workbooks, and this scenario is only supported when both workbooks are open. If you close the source workbook, any linked dynamic array formulas will return a #REF! error when they are refreshed.

Examples

FILTER used to return multiple criteria

In this case, we’re using the multiplication operator (*) to return all values in our array range (A5:D20) that have Apples AND are in the East region: =FILTER(A5:D20,(C5:C20=H1)*(A5:A20=H2),»»).

Using FILTER with the multiplication operator (*) to return all values in our array range (A5:D20) that have Apples AND are in the East region.

FILTER used to return multiple criteria and sort

In this case, we’re using the previous FILTER function with the SORT function to return all values in our array range (A5:D20) that have Apples AND are in the East region, and then sort Units in descending order: =SORT(FILTER(A5:D20,(C5:C20=H1)*(A5:A20=H2),»»),4,-1)

Using FILTER with the SORT function to return all values in our array range (A5:D20) that have Apples AND are in the East region, and then sort Units in descending order.

In this case, we’re using the FILTER function with the addition operator (+) to return all values in our array range (A5:D20) that have Apples OR are in the East region, and then sort Units in descending order: =SORT(FILTER(A5:D20,(C5:C20=H1)+(A5:A20=H2),»»),4,-1).

FILTER and SORT together - Filter by Product (Apple) OR by Region (East)

Notice that none of the functions require absolute references, since they only exist in one cell, and spill their results to neighboring cells.

Need more help?

You can always ask an expert in the Excel Tech Community or get support in the Answers community.

See Also

RANDARRAY function

SEQUENCE function

SORT function

SORTBY function

UNIQUE function

#SPILL! errors in Excel

Dynamic arrays and spilled array behavior

Implicit intersection operator: @

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

The FILTER function «filters» a range of data based on supplied criteria. The result is an array of matching values from the original range. In plain language, the FILTER function will extract matching records from a set of data by applying one or more logical tests. Logical tests are supplied as the include argument and can include many kinds of formula criteria. For example, FILTER can match data in a certain year or month, data that contains specific text, or values greater than a certain threshold.

The FILTER function takes three arguments: array, include, and if_empty. Array is the range or array to filter. The include argument should consist of one or more logical tests. These tests should return TRUE or FALSE based on the evaluation of values from array. The last argument, if_empty, is the result to return when FILTER finds no matching values. Typically this is a message like «No records found», but other values can be returned as well. Supply an empty string («») to display nothing.

The results from FILTER are dynamic. When values in the source data change, or the source data array is resized, the results from FILTER will update automatically. Results from FILTER will «spill» onto the worksheet into multiple cells.

Basic example

To extract values in A1:A10 that are greater than 100:

=FILTER(A1:A10,A1:A10>100)

To extract rows in A1:C5 where the value in A1:A5 is greater than 100:

=FILTER(A1:C5,A1:A5>100)

Notice the only difference in the above formulas is that the second formula provides a multi-column range for array. The logical test used for the include argument is the same.

Note: FILTER will return a #CALC! error if no matching data is found

Filter for Red group

Filter on red group example

In the example shown above, the formula in F5 is:

=FILTER(B5:D14,D5:D14=H2,"No results")

Since the value in H2 is «red», the FILTER function extracts data from array where the Group column contains «red». All matching records are returned to the worksheet starting from cell F5, where the formula exists.

Values can be hardcoded as well. The formula below has the same result as above with «red» hardcoded into the criteria:

=FILTER(B5:D14,D5:D14="red","No results")

No matching data

The value for is_empty is returned when FILTER does not find matching results. If a value for if_empty is not provided, FILTER will return a #CALC! error if no matching data is found:

=FILTER(range,logic) // #CALC! error

Often, is_empty is configured to provide a text message to the user:

=FILTER(range,logic,"No results") // display message

To display nothing when no matching data is found, supply an empty string («») for if_empty:

=FILTER(range,logic,"") // display nothing

Values that contain text

To extract data based on a logical test for values that contain specific text, you can use a formula like this:

=FILTER(rng1,ISNUMBER(SEARCH("txt",rng2)))

In this formula, the SEARCH function is used to look for «txt» in rng2, which would typically be a column in rng1. The ISNUMBER function is used to convert the result from SEARCH into TRUE or FALSE. Read a full explanation here.

Filter by date

FILTER can be used with dates by constructing logical tests appropriate for Excel dates. For example, to extract records from rng1 where the date in rng2 is in July you can use a generic formula like this:

=FILTER(rng1,MONTH(rng2)=7,"No data") 

This formula relies on the MONTH function to compare the month of dates in rng2 to 7.  See full explanation here.

Multiple criteria

At first glance, it’s not obvious how to apply multiple criteria with the FILTER function. Unlike older functions like COUNTIFS and SUMIFS, which provide multiple arguments for entering multiple conditions, the FILTER function only provides a single argument, include, to target data. The trick is to create logical expressions that use Boolean algebra to target the data of interest and supply these expressions as the include argument. For example, to extract only data where one value is «A» and another is greater than 80, you can use a formula like this:

=FILTER(range,(range="A")*(range>80),"No data")

The math operation of addition (*) joins the two conditions with AND logic: both conditions must be TRUE in order for FILTER to retrieve the data. See a detailed explanation here.

Complex criteria

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. For example, the generic formula below filters based on three separate conditions: account begins with «x» AND region is «east», and month is NOT April.

=FILTER(data,(LEFT(account)="x")*(region="east")*NOT(MONTH(date)=4))

See this page for a full explanation. Building criteria with logical expressions is an elegant and flexible approach that can be extended to handle many complex scenarios. See below for more examples.

Notes

  1. FILTER can work with both vertical and horizontal arrays.
  2. The include argument must have dimensions compatible with the array argument, otherwise FILTER will return #VALUE!
  3. If the include array includes any errors, FILTER will return an error.

Функция ФИЛЬТР позволяет выполнять фильтрацию диапазона данных на основе определенных условий.

Описание функции ФИЛЬТР

Функция ФИЛЬТР является одной из семи функций, которые Microsoft анонсировала 24 сентября 2018 года вместе с революционным нововведением использования динамических массивов в Excel. Данная функция, как и остальные 6 и возможность использования динамических массивов не должна быть доступна пользователям, купившим Office 2019 и, тем более, более ранним версиям.

Воспользоваться новыми возможностями смогут пользователи с подпиской Office 365, а в будущем пользователи Office 2021 (следующей версией, которая следует за Office 2019), если к тому времени Microsoft попросту не оставит только вариант с подпиской.

Данная функция своим функционалом полностью замещает возможности расширенного фильтра в Excel, который хоть и предоставлял большую гибкость по сравнению с автофильтром, но многие пользователи так и не смогли освоить его использование.

Синтаксис

=ФИЛЬТР(массив; включить; [если_пусто])

Аргументы

массиввключитьесли_пусто

Обязательный. Массив или диапазон для фильтрации

Обязательный. Массив логических переменных с аналогичной высотой или шириной, что и массив. Условие записывается с использование функционала формул динамического массива, т.е. массив значений равен значению определенной ячейки.

На рисунке выше видно, что вторым аргументом записано условие: когда значение из диапазона равно Яблоко, последний, не обязательный, аргумент опущен.

Необязательный. Значение, возвращаемое, если все значения во включенном массиве пустые (фильтр не возвращает ничего)

Замечания

  • Функция ФИЛЬТР (FILTER) использует возможности динамических массивов Excel, это означает, что результат вычисления будет автоматически распространяться на смежные ячейки. Также это означает, что нет необходимости фиксировать ячейки абсолютными ссылками в формуле, равно как и использовать автозаполнение;
  • Если нужно отфильтровать значение по нескольким условиям, то для логического И используется знак умножения *

    На рисунке выше представлен результат фильтрации по продукту Яблоко из региона Восток;

  • Если нужно отфильтровать значение по нескольким условиям, то для логического ИЛИ используется знак суммирования +

    На рисунке выше диапазон отфильтрован по продукту Яблоко или из региона Восток;

  • Если результат вычисления формулы должен заполнить ячейки, которые уже заняты, то будет возвращена ошибка #ПЕРЕНОС!

    После очистки ячейки/ ячеек, которые «стоят на пути» вычисления формулы, формула вернет результат.

Пример

Видео работы функции

Дополнительные материалы

Файл из видео.

Microsoft добавила динамические массивы в Excel и новые функции.

Can you filter your table data using an Excel FILTER Formula?

Yes, you can!

It is definitely possible now with Excel FILTER Formula. It is a new formula introduced in Office 365 released in 2018!

In this article, you will be provided with a detailed guide on:

  • Excel Filter Formula
  • Filtering with Multiple Criteria
  • Filter formula not working

Excel Filter Formula

The FILTER formula in Excel is available in Office 365 only.

It is an in-built formula in Excel used to filter an array or range based on the criteria you specify and extract matching records.

It is part of Dynamic Array functions and the result provided by this formula is an array that spills on the worksheet automatically.

What does it do?

Filters a table array based on the filtering condition given

Formula breakdown:

=FILTER(array, include, [if_empty])

What it means:

  • array – data to be filtered.
  • include – logical test supplied as criteria. It should have the same height or width as the array.
  • if_empty – value to display if the filter results in no records. It is an optimal argument.

Generally, Excel user filters data using the Autofilter button present under the Data Tab. But the drawback of using the filter buttons is that it does not update results automatically when you make changes in the data.

Whereas, the Excel FILTER function in Excel is dynamic i.e. when the values in the data sources change the result from this formula will update automatically.


Want to know How To Master the Excel FILTER Formula?

Watch on YouTube and give it a thumbs up 👍

Excel FILTER Formula | MyExcelOnline

In the example below, we have a tax table that we want to dynamically filter with a given rate. So, we want to extract the income levels for which the tax rate is greater than 33%

Excel FILTER Formula | MyExcelOnline

Follow our step by step guide below with free downloadable Excel workbook to practice:

STEP 1: We need to enter the FILTER function in a blank cell:

=FILTER(

FILTER Formula in Excel

STEP 2: The Excel FILTER formula arguments:

array

What is the data to be filtered?

Select the cells containing the tax data, do not include the headers:

=FILTER(C9:D14,

FILTER Formula in Excel

include

What is your filtering condition?

We want to filter the tax rate that is greater than the specified rate. Type in the condition as the tax rate column > the specific tax rate.

=FILTER(C9:D14, D9:D14>G8

FILTER Formula in Excel

[if_empty]

What is the value to display in case nothing gets matched?

Just place an empty string to be displayed if nothing gets matched.

=FILTER(C9:D14, D9:D14>G8, “”)

excel filter formula

Try it out now with different values and see it get filtered magically!

FILTER Formula in Excel

FILTER Formula in Excel

This formula can handle multiple criteria as well. Let’s check it out!

Filtering with Multiple Criteria

In this example, we have sales data and we want to filter data when the salesperson is Ian Wright and Product is Tonic.

Excel FILTER Formula | MyExcelOnline

Let’s use the FILTER formula wth multiple criteria and get this done!

STEP 1: Enter the FILTER function in cell G12.

=FILTER(

Excel FILTER Formula | MyExcelOnline

STEP 2: Select the array that needs to be filtered i.e. A9: E56

=FILTER(A9:E56

Excel FILTER Formula | MyExcelOnline

Now, you add multiple criteria you need to make sure that the two logical tests are separated by a multiplication operator.

=FILTER(array, (range1=criteria1) * (range2=criteria2))

STEP 2: Add the first range (salesperson) and its criteria (Ian Wright) i.e. C9: C56 and G9 respectively.

=FILTER(A9:E56, (C9:C56=G9)

Excel FILTER Formula | MyExcelOnline

STEP 3: Insert a Multiplication Operator and then add the second range (product) and its criteria (Tonic) i.e. D9: D56 and H9 respectively.

=FILTER(A9:E56, (C9:C56=G9) *(D9:D56=H9)

Excel FILTER Formula | MyExcelOnline

STEP 4: Add the text to display if the filtering results in no record i.e. No Entry Found.

=FILTER(A9:E56, (C9:C56=G9) *(D9:D56=H9),”No Entry Found”)

Excel FILTER Formula | MyExcelOnline

This is how you can use the Excel FILTER formula with single or multiple criteria.

Excel FILTER Formula | MyExcelOnline

Byt, there may be times when you might encounter an error when using filter function Excel. Let’s look at some of those errors and how to correct them!

Filter formula not working

#SPILL Error

This error occurs if one or more cells where the result will be displayed in not blank.

In this example, as you can see there is already text (-) in cell G13. The FILTER formula is showing error.

Excel FILTER Formula | MyExcelOnline

To fix it, simply delete any contents present in those cells and the desired result will appear.

Excel FILTER Formula | MyExcelOnline

#CALC! Error

This error occurs when if_empty is omitted and there is no entry matching the criteria provided.

In this example, as you can see there is no text present of if_empty argument and there are no records for salesperson Ian Wright and product Drinks, there is an #CALC! error.

Excel FILTER Formula | MyExcelOnline

To fix it, simply add a text in the formula’s if_empty argument.

Excel FILTER Formula | MyExcelOnline

#VALUE Error

One of the reasons why no may encounter this error is that neither the height or width of the include argument matches that of the array argument.

In this example, the height of the array is from row 9 to row 56 but height for include is for row 9 to row 50. So, Excel displays an #VALUE! error!

Excel FILTER Formula | MyExcelOnline

To fix it, simply make sure that the height or width of include is the same as the array.

Excel FILTER Formula | MyExcelOnline

Excel FILTER Formula | MyExcelOnline

This post will guide you how to extracts matched values using FILTER function in Microsoft Excel 365. And also will introduce that how to use FILTER function with same examples in Excel 365.

Table of Contents

  • Excel Filter Function
  • Entering FILTER Formula in Excel
  • Excel filtering by a single criteria
    • Example 1: How to use a number as a filter
    • Example 2: How to filter in Excel by a cell value
    • Example 3: Using Excel’s text filter
    • Example 4: Using NOT EQUAL TO as a FILTER condition in Excel
    •  Example 5: How to use the date filter in Excel
    • Example 6: Filtering by date in Excel
    • Example 7: Filtering based on two Conditions
    • Example 8: Filtering Based on Two Conditions using OR Logic
    • Example 9: Filter Data in Excel from Another Sheet
    • Example 10: Providing Maximum Number of Rows of Filtered Data
  • Conclusion
    • Related Functions

The FILTER function “filters” a set of data according to the conditions specified. The outcome is an array of values that match those in the original range. Simply said, the FILTER function extracts matched records from a collection of data using one or more logical checks. The include argument specifies logical tests, which might encompass a wide variety of formula conditions. For instance, FILTER may match data from a given year or month, data containing specific content, or numbers above a specified threshold.

=FILTER(array,include,[if empty])

Three parameters are required for the FILTER function: array, include, and if empty.

Where:

  • Array – This is required argument. The range or array to filter is specified by array.
  • Include – This is required argument. Include one or more logical tests in the include These tests should return TRUE or FALSE depending on the array values evaluated.
  • If_empty – This is option argument. The last input, if empty, specifies the value to return if FILTER does not discover any matching values. Typically, this is a message along the lines of “No records found,” although other values may also be returned. To show nothing, provide an empty string (“”).

Entering FILTER Formula in Excel


FILTER provides dynamic results. When the values in the source data change or the size of the source data array changes, the FILTER results are updated automatically. The results of FILTER will “leak” into numerous cells on the worksheet.

To filter data in Excel using the FILTER function, follow these steps:

Step1: To begin your filter formula, enter =FILTER(.

Step2: Enter the address for the range of cells containing the data you want to filter, for example, A2:C10.

Step3: Type a comma, followed by the filter's condition, such as B2:B20>3 (To specify a condition, type the address of the “criteria column,” such as C1:C, followed by an operator symbol such as greater than (>), and finally the criterion, such as the number 3.

Step4: Complete the parenthesis with a closing parenthesis and then hit enter on the keyboard. Your full formula will appear as follows: =FILTER(A2:C10, B2:B20>3)

I’ll begin with the fundamentals of utilizing the FILTER function, and then demonstrate some more advanced uses of the FILTER function. This article discusses the FILTER function as a formula entered into spreadsheet cells, not the filter command accessible from the toolbar and pop-up menus.

While using the FILTER function in Excel is almost identical to using it in Google Sheets, there are some subtle variations.

Excel filtering by a single criteria


To begin, let’s review how to use Excel’s FILTER function in its simplest version, with a single condition/criteria.

I’ll demonstrate how to filter data using a number, a cell value, a text string, or a date… and I’ll also demonstrate how to utilize a variety of “operators” in the filter condition (Less than, Equal to, etc…).

Example 1: How to use a number as a filter


In this first demonstration of how to use the filter tool in Excel, we have a list of students and their grades and wish to create a filtered list of only students with flawless grades.

The assignment: Display a list of students and their grades, but only those who have earned an A.

The reasoning: Filter the range A2:B10 for values larger than 0.7 in the column B2:B10 (70 percent ). Then you can use the following FILTER formula,type:

=FILTER(A2:B10, B2:B10 >0.7)

excel filter function

Example 2: How to filter in Excel by a cell value


In this excel filter function example, we want to do the same thing as stated before, but rather than inputting the condition straight into the formula, we’re going to use a cell reference.

When you filter in Excel by a cell value, your sheet is configured in such a way that you may alter the value in the cell at any moment, which updates the value to which the filter criterion is tied.

In this example, rather than explicitly entering the value “0.8” into the formula, the filter criterion is set to cell G1, which contains the “0.8” value.

The assignment: Display a list of students and their grades, but only those with a score of less than 80%.

The reasoning: Filter the range A2:B10 to the extent that B2:B10 is smaller than the value supplied in column G1 (0.8).

You can use the following FILTER formula, type:

=FILTER(A2:B10, B2:B10 <G1)

excel filter function

Example 3: Using Excel’s text filter


In this example, we’ll utilize a text string as the filter formula’s criterion. This is fairly similar to using a number, except that the text to filter must be enclosed in quote marks.

We are filtering a list of customers and their payment status in this instance, and we want to present just customers with a payment status of “Payed“.

The objective is to provide a list of clients that have paid on their payments.

The reasoning: Filter the range A2:B6 by substituting the string “ Payed ” for B2:B6.

The following formula: In this example, the formula below is typed in the cell (E1).

=FILTER(A3:B12, B2:B6=" Payed ")

excel filter function

Example 4: Using NOT EQUAL TO as a FILTER condition in Excel


Now that you have a working knowledge of how to use the filter function in Excel, here is another example of filtering by a string of text, but this time we will use the “not equal” operator (<>) to demonstrate how to filter a range and return data that is NOT equal to the criteria you set.

Additionally, we will utilize a bigger data set in this example to show a more comprehensive usage of the FILTER function in the real world.

You may be surprised at how often a circumstance arises in which you need to filter data that is “not equal to” a certain number or piece of text.

In this example, we’ll use a report/spreadsheet to display data from sales calls that occur at your organization, and we’ll filter the data to exclude a certain sales person (Scott) from the result.

The assignment: Display sales call statistics for all sales representatives except ” Scott “.

The reasoning: Filter the range A2:C10 for values A2:A10 that DO NOT match the string “Scott “.

The following formula: In this example, the formula below is typed in the cell (E1).

=FILTER(A2:C10, A2:A10 <>"Scott")

excel filter function

Take note that the filtered data on the right side of the figure above does not include any of Scott ‘s rows/calls.

 Example 5: How to use the date filter in Excel


Filtering in Excel by a date may be accomplished in a few different methods, which I will demonstrate below. If you attempt to put a date into the FILTER function in the same way that you would typically type into a cell, the formula will fail to operate properly.

Therefore, you may either enter the date you want to filter into a cell and then reference that cell in your formula… Alternatively,  you may use the DATE function.

When filtering by date, the same operators (>, =, etc…) are available as they are in other FILTER function applications. Each individual day/date in Excel is merely a number that has been formatted differently. In Excel, for example, the date “01/30/2022” is just the serial number “44591” formatted as a date. Each time you add a day to the calendar, this number increases by one… For example, “44591” “44592” “44593”

Thus, if one date is farther in the future, it might be regarded “greater than” another. In contrast, if one date is farther in the past, it might be considered to be “less than” another.

In this example, we’ll use a cell reference to filter on a date. This is identical to the example discussed in Example 2, except that we are dealing with dates instead of percentages.

Consider the following scenario: we want to filter a list of students, their exam results, and the dates on which the tests were administered… and we wish to display only tests conducted before to June (05/01/2022).

=FILTER(A2:C10, C2:C10 <G1)

excel filter function

Example 6: Filtering by date in Excel


In this example of date filtering in Excel, we’ll use the same data as in the previous one and attempt to obtain the same results… however, instead of referencing a cell, we’ll utilize the DATE function, which allows you to put the date straight into the FILTER function.

When using the DATE function to provide a date, you must first input the year, followed by the month and finally the day… each denoted with a comma (shown below).

The assignment: Display only exams given before to May

The reasoning: Filter the range A2:C10 so that C2:C10 is less than or equal to the date (05/01/2022).

The following formula: In this example, the formula below is typed in the cell (D3).

=FILTER(A2:C10,C2:C10<DATE(2022,5,1))

excel filter function

Example 7: Filtering based on two Conditions


When utilizing the Excel FILTER function, you may want to produce data that fits many criteria. I’ll demonstrate two methods for filtering by several criteria in Excel, depending on the scenario and the desired behavior of the calculation.

The conventional method of adding another condition to your filter function (as shown by the Excel formula syntax) allows you to provide a second condition, where both the first AND second conditions must be fulfilled in order for the filter output to be returned.

However, I will demonstrate how to make a little tweak to the function so that you may choose to return/display in the filter function’s output/destination a second condition where EITHER condition might be satisfied. (To utilize AND logic, separate the conditions with an asterisk, or use a plus symbol to separate the criteria.)

In this example, we’re going to filter a collection of data and show those rows that satisfy BOTH the first and second conditions.

To utilize a second condition in this manner (using AND logic), just insert it after the first condition in the formula, separated by an asterisk (*). Each condition must be included in a separate pair of parentheses.

When a filter formula is used with several conditions, the columns referenced in each condition must be distinct.

In this case, we’d want to filter a list of clients based on their payment status and region… and to display those customers who are both current members AND paid on their payment status.

The objective is to provide a list of customers who are paid on payments, but only those who are in East region.

The reasoning: Filter the range A2:C6 such that B2:B6 equals the text “Paid,” AND C2:C6 equals the text “East“.

The following formula: In this example, the formula below is typed in the blue cell (E1).

=FILTER(A2:C6,( B2:B6="Paid")*( C2:C6 ="East"))

excel filter function

Example 8: Filtering Based on Two Conditions using OR Logic


In this example, we’re going to filter a collection of data and show those rows that satisfy either the first OR the second criterion.

To utilize a second condition in this manner (using OR logic), just insert it after the first condition in the formula, separated by a plus sign. Each condition must be included in a separate pair of parentheses (shown below).

When used in this manner, the FILTER formula allows you to choose criteria from the same or separate columns.

In this case, we’re filtering the same customer data as in the previous example, but this time we’re displaying a list of customers who either are in East region OR have paid on a payment. This will generate a list of clients to whom a payment notification have paid… whether they are current members or east region who have paid on their last payment.

The objective is to provide a list of customers who are in East region, as well as customers who have paid on payments regardless of whether they are in East region.

The following formula: In this example, the formula below is typed in the cell (E1).

=FILTER(A2:C6, (B2:B6="Paid ")+(C2:C6=" East ")

excel filter function

Example 9: Filter Data in Excel from Another Sheet


You may often encounter instances in Excel when you need to filter data from another sheet, where your raw unfiltered data is on one tab and your filter formula is on another sheet.

This may be accomplished by simply referring to a certain sheet’s name when providing the filter’s ranges. Thus, while you would typically give a range such as “A1:B4,” when referring another sheet when filtering, you indicate the sheet name by preceding the range with the sheet name and an exclamation mark, as in “SheetName!A1:B4“.

However, if the sheet name contains a space, an apostrophe must be used before and after the sheet name, as in "Sheet Name!" A1:B4.

The following is an example of how to filter data in Excel from a separate sheet, where the filter formula is located on a different sheet than the source range.

Consider the following scenario: On one sheet, you have a list of customers and their payment status, and you wish to present a filtered list of  paid customer on another sheet.

The job is to filter the list of customers on the Sheet3 and to display a separate list of customer names with a pay status on another worksheet.

The reasoning: Filter the range using the Sheet3 command! A2:C6, where ‘ Sheet3′ is the range! B2:B6 corresponds to the phrase “Paid“.

The following formula: In this example, the formula below is typed in the cell (A3).

=FILTER(Sheet3! A2:C6, Sheet3!B2:B6="Paid")

excel filter function

Example 10: Providing Maximum Number of Rows of Filtered Data


If your FILTER formula provides a large number of rows but your worksheet is restricted in space and you are unable to erase the data below, you may limit the amount of rows returned by the FILTER function.

Let us demonstrate how it works using a simple formula that filter data that grade is less than 0.7 from filter value in Cell F1:

=FILTER(A2:C10, B2:B10<F1)

excel filter function

The preceding formula produces all records that it discovers, in this instance five rows. However, imagine you only have room for two. To output just the first two rows discovered, follow these steps:

Step1: Incorporate the FILTER formula into the INDEX function’s array parameter

Step2: Use a vertical array constant such as 1;2 as the row num input to INDEX. It specifies the number of rows to return (2 in our case).

Step3: Use a horizontal array constant such as 1,2 for the column num parameter. It defines the columns that should be returned (the first 2 columns in this example).

Step4: To account for any mistakes caused by the absence of data meeting your criteria, you may wrap your calculation in the IFERROR function.

The entire excel filter formula is as follows:

=IFERROR(INDEX(FILTER(A2:C10, B2:B10<F1), {1;2},{1,2}), "No Found")

excel filter function

Conclusion


This section discusses the FILTER function and its many uses. In general, when it comes to time management, we need this feature for a variety of reasons. I demonstrated various techniques with accompanying examples, however there might be countless further iterations based on a variety of circumstances. If you know of another way to use this function, please share it with us.


  • Excel IFERROR function
    The Excel IFERROR function returns an alternate value you specify if a formula results in an error, or returns the result of the formula.The syntax of the IFERROR function is as below:= IFERROR (value, value_if_error)….
  • Excel INDEX function
    The Excel INDEX function returns a value from a table based on the index (row number and column number)The INDEX function is a build-in function in Microsoft Excel and it is categorized as a Lookup and Reference Function.The syntax of the INDEX function is as below:= INDEX (array, row_num,[column_num])…

Понравилась статья? Поделить с друзьями:
  • Filter excel на русском
  • Filter excel with list
  • Filter excel merged cells
  • Filter dates in excel
  • Filter data with vba excel