Excel filter not in range

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.

Author: Oscar Cronquist Article last updated on November 27, 2018

The formulas above extracts values that exists only in one or the other cell range, if you are looking for a formula that compares two separate columns the go here: Compare two columns and show differences

Array formula in B13:

=TEXTJOIN(«», TRUE, IF(MIN(IF(((COUNTIF($B$7:$E$10, $B$2:$D$4)=0)+COUNTIF(B12:$B$12, $B$2:$D$4))=1, (ROW($B$2:$D$4)+(1/(COLUMN($B$2:$D$4)+1)))*1, «»))=(ROW($B$2:$D$4)+(1/(COLUMN($B$2:$D$4)+1)))*1, $B$2:$D$4, «»))

Array formula in B22:

=TEXTJOIN(«», TRUE, IF(MIN(IF(((COUNTIF($B$2:$D$4, $B$7:$E$10)=0)+COUNTIF(B20:$B$20, $B$7:$E$10))=1, (ROW($B$7:$E$10)+(1/(COLUMN($B$7:$E$10)+1)))*1, «»))=(ROW($B$7:$E$10)+(1/(COLUMN($B$7:$E$10)+1)))*1, $B$7:$E$10, «»))

To enter an array formula, type the formula in a cell then press and hold CTRL + SHIFT simultaneously, now press Enter once. Release all keys.

The formula bar now shows the formula with a beginning and ending curly bracket telling you that you entered the formula successfully. Don’t enter the curly brackets yourself.

If you don’t own an Excel version that has the TEXTJOIN function then use the following considerably larger formula.

Array formula in B13:

=INDEX($B$2:$D$4, MIN(IF((COUNTIF($B$7:$E$10, $B$2:$D$4)=0)+COUNTIF(B12:$B$12, $B$2:$D$4)=1, ROW($B$2:$D$4)-MIN(ROW($B$2:$D$4))+1, «»)), MATCH(0, COUNTIF($B$7:$E$10, INDEX($B$2:$D$4, MIN(IF((COUNTIF($B$7:$E$10, $B$2:$D$4)=0)+COUNTIF(B12:$B$12, $B$2:$D$4)=1, ROW($B$2:$D$4)-MIN(ROW($B$2:$D$4))+1, «»)), , 1))+COUNTIF(B12:$B$12, INDEX($B$2:$D$4, MIN(IF((COUNTIF($B$7:$E$10, $B$2:$D$4)=0)+COUNTIF(B12:$B$12, $B$2:$D$4)=1, ROW($B$2:$D$4)-MIN(ROW($B$2:$D$4))+1, «»)), , 1)), 0))

copied down as far as necessary.

Formula in B21:

=INDEX(Two, MIN(IF((COUNTIF(One, Two)=0)+COUNTIF(B$20:$B20, Two)=1, ROW(Two)-MIN(ROW(Two))+1, «»)), MATCH(0, COUNTIF(One, INDEX(Two, MIN(IF((COUNTIF(One, Two)=0)+COUNTIF(B$20:$B20, Two)=1, ROW(Two)-MIN(ROW(Two))+1, «»)), , 1))+COUNTIF(B$20:$B20, INDEX(Two, MIN(IF((COUNTIF(One, Two)=0)+COUNTIF(B$20:$B20, Two)=1, ROW(Two)-MIN(ROW(Two))+1, «»)), , 1)), 0)) + CTRL + SHIFT + ENTER

copied down as far as necessary.

Explaining formula in cell B13

Step 1 — Identify values not shared by the ranges

The COUNTIF function counts values based on a condition or criteria, in this case, it counts values between the cell ranges.

COUNTIF($B$7:$E$10, $B$2:$D$4)=0

becomes

COUNTIF({«HH», «II», «JJ», «KK»;»AA», «MM», «NN», «OO»;»AA», «QQ», «RR», «SS»;»TT», «II», «VV», «CC»}, {«AA», «BB», «CC»;»DD», «BB», «EE»;»FF», «CC», «GG»})=0

becomes

{2,0,1;0,0,0;0,1,0}=0

and returns

{FALSE, TRUE, FALSE;TRUE, TRUE, TRUE;TRUE, FALSE, TRUE}.

Step 2 — Prevent duplicates in list

COUNTIF(B12:$B$12, $B$2:$D$4)

becomes

COUNTIF(«Values existing in range One but not in range Two», {«AA», «BB», «CC»;»DD», «BB», «EE»;»FF», «CC», «GG»})

and returns

{0,0,0;0,0,0;0,0,0}.

Step 3 — Add arrays

Check if array is equal to 1.

((COUNTIF($B$7:$E$10, $B$2:$D$4)=0)+COUNTIF(B12:$B$12, $B$2:$D$4))=1

becomes

({FALSE, TRUE, FALSE;TRUE, TRUE, TRUE;TRUE, FALSE, TRUE}+{0,0,0;0,0,0;0,0,0})=1

becomes

{0,1,0;1,1,1;1,0,1}=1

and returns

{FALSE,TRUE,FALSE;TRUE,TRUE,TRUE;TRUE,FALSE,TRUE}.

Step 4 — Convert TRUE to a unique number

IF(((COUNTIF($B$7:$E$10, $B$2:$D$4)=0)+COUNTIF(B12:$B$12, $B$2:$D$4))=1, (ROW($B$2:$D$4)+(1/(COLUMN($B$2:$D$4)+1)))*1, «»)

becomes

IF({FALSE, TRUE, FALSE;TRUE, TRUE, TRUE;TRUE, FALSE, TRUE}, (ROW($B$2:$D$4)+(1/(COLUMN($B$2:$D$4)+1)))*1, «»)

becomes

IF({FALSE, TRUE, FALSE;TRUE, TRUE, TRUE;TRUE, FALSE, TRUE}, {2.33333333333333, 2.25, 2.2;3.33333333333333, 3.25, 3.2;4.33333333333333, 4.25, 4.2}, «»)

and returns

{«», 2.25, «»;3.33333333333333, 3.25, 3.2;4.33333333333333, «», 4.2}

Step 5 — Find smallest number in array

The MIN function returns the minimum number in the given array.

MIN(IF(((COUNTIF($B$7:$E$10, $B$2:$D$4)=0)+COUNTIF(B12:$B$12, $B$2:$D$4))=1, (ROW($B$2:$D$4)+(1/(COLUMN($B$2:$D$4)+1)))*1, «»))

becomes

MIN({«», 2.25, «»;3.33333333333333, 3.25, 3.2;4.33333333333333, «», 4.2})

and returns 2.25

Step 6 — Find position in array

IF(MIN(IF(((COUNTIF($B$7:$E$10, $B$2:$D$4)=0)+COUNTIF(B12:$B$12, $B$2:$D$4))=1, (ROW($B$2:$D$4)+(1/(COLUMN($B$2:$D$4)+1)))*1, «»))=(ROW($B$2:$D$4)+(1/(COLUMN($B$2:$D$4)+1)))*1, $B$2:$D$4, «»)

becomes

IF(2.25=(ROW($B$2:$D$4)+(1/(COLUMN($B$2:$D$4)+1)))*1, $B$2:$D$4, «»)

becomes

IF(2.25={2.33333333333333, 2.25, 2.2;3.33333333333333, 3.25, 3.2;4.33333333333333, 4.25, 4.2}, $B$2:$D$4, «»)

and returns {«»,»BB»,»»;»»,»»,»»;»»,»»,»»}.

Step 7 — Concatenate strings in array

The TEXTJOIN function returns values concatenated ignoring blanks in array.

TEXTJOIN(«», TRUE, IF(MIN(IF(((COUNTIF($B$7:$E$10, $B$2:$D$4)=0)+COUNTIF(B12:$B$12, $B$2:$D$4))=1, (ROW($B$2:$D$4)+(1/(COLUMN($B$2:$D$4)+1)))*1, «»))=(ROW($B$2:$D$4)+(1/(COLUMN($B$2:$D$4)+1)))*1, $B$2:$D$4, «»))

becomes

TEXTJOIN(«», TRUE, {«»,»BB»,»»;»»,»»,»»;»»,»»,»»})

and returns «BB» in cell B13.

Get Excel *.xlsx file

Filter values existing in Range 1 but not in Range 2.xlsx

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.

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])…

Facing problem just because your filter not working in Excel? No need to suffer from this problem anymore….!

As today I have chosen this specific topic of “Excel filter not working” to answer. All in all this post will help you to explore the reasons behind why Filter Function Not Working In Excel and ways to fix Excel filter not working issue.

Why Is Your Filter Not Working In Excel And Ways To Fix It?

Reason 1# Excel Filter Not Working With Blank Rows

One very common problem with the Excel filter function is that it won’t work with the blank rows. Excel Filter doesn’t count the cells with the first blank spaces.

To fix this, you need to choose the range right before using the filter function. For a clearer idea of how to perform this task, check out the following example.

  • Before using the Excel filter function on the column C. either you can choose the column “C” completely or just select the data which you want to filter out.

Excel Filter Not Working With Blank Rows 1

  • From the “data” tab select the “Filter” option. Now all the items become visible in the filter checkbox list or filtered list.

Excel Filter Not Working With Blank Rows 2

  • Similarly, you have to choose the cell ranges or multiple columns before the application of the filter function.

Excel Filter Not Working With Blank Rows 3

To fix damaged Excel workbook, we recommend this tool:

This software will prevent Excel workbook data such as BI data, financial reports & other analytical information from corruption and data loss. With this software you can rebuild corrupt Excel files and restore every single visual representation & dataset to its original, intact state in 3 easy steps:

  1. Download Excel File Repair Tool rated Excellent by Softpedia, Softonic & CNET.
  2. Select the corrupt Excel file (XLS, XLSX) & click Repair to initiate the repair process.
  3. Preview the repaired files and click Save File to save the files at desired location.

Reason 2# Make Proper Selection Of The Data

If your spreadsheet contains empty rows or columns. Or if you only want to filter out only the specific range then choose the section which you want to filter prior to turning on the Filter.

If you don’t choose the area then Excel applies the filter on the complete one. This can also result in selection up to the first empty column or rows excluding the data present after the blanks.

So it will be better if you manually select the data in which you want to apply the Excel filter function.

  • In order to remove the blank rows from the selected filter area. First of all turn on the filter and then click on the drop-down arrow present in any columns to show the filter list.
  • Now remove the check sign across the ‘(Select All)’ after then shift right on the bottom of the filter list. Choose the ‘(Blanks)’ option and tap to the OK.

Excel-Filter-Blanks

  • After this only, the blank rows will clearly appear on your screen.
  • For easy identification, the row number of each blank row appears in blue color.
  • For deleting up these blank rows. You need to select these rows first and then make a right-click over the anyone of the blue color row number. Choose the Delete option from the listed option to delete the select blank rows.

Excel-Filter blanks 2

  • By turning off the filter you can see the rows that are now been removed.

Reason 3# Check The Column Headings

  • Check the data which has only one row of column headings.
  • In order to get multiple lines for the heading, into the cell you just need to type the first line. After that press “ALT + ENTER” option for typing in the new line of the cell.
  • In such cases, the Wrap Text function also works great in formatting the cells correctly.

Check your column headings

Reason 4# Check For Merged Cells

Another reason for your Excel filter not working is because of the merged cells.

So unmerge if you have any merged cells in the spreadsheet.

If the column headings are being merged, then the Excel filter becomes unable to choose the items present from the merged columns.

The same thing happens with the merged rows. Excel filter won’t count the merged rows data.

Check for merged cells

For unmerging the cells:

  • Go to the Home tab and to the Alignment group.

  • Now hit the down arrow present across Merge & Center and choose the Unmerge Cells option.

unmerge cells

Reason 5# Check For Errors

Check carefully that your data doesn’t include any errors.

Suppose, if you are filtering the ‘Top 10’, ‘Above Average’ or ‘Below Average’ values within your list then using the Number Filters gets compulsory. Otherwise, the error may hinder your Excel application to apply the filter.

  • For removing up the errors use the filters to fetch them. Usually, they get listed at the list’s bottom so scroll down.
  • Choose the error and tap to the OK option. After locating up the error, fix or delete it and then only clear up the filter.

Check for errors

Reason 6# Check For The Hidden Rows

On the Excel filter, list hidden rows won’t appear as the filter option.

  • For unhiding the rows firstly you need to choose the area having the hidden rows. This means you have to choose the rows to present below or above of the hidden data.
  • After that either you can make a right-click over the rows header area. Or you can choose the Unhide option. OR just go to the Home tab > cells group> FormatHide & Unhide> Unhide Rows option.

unhide excel cells

Reason 7# Check For The Other Filters

Check that your filter is not been left on any other column.

The best option for clearing up all the Excel filters is by tapping to the Clear button present on the ribbon (which is on the right section of the filter button).

clear excel filter

This will leave the filter turned on, but it will clear all the filter settings. So now you can make a fresh start with your complete data.

Reason 8# The Filter Button Is Greyed Out

If your Filter function button is appearing gray in color then it means that the filter not working in Excel. The reason behind this can be that your grouped worksheets.

So check out whether your worksheets are grouped or not.

  • You can easily identify it by watching out the title bar where generally the filename appears at the screen top.
  • If the ‘Your file name’ – Group is appearing then it means that your worksheet is grouped.

Group-Worksheets-in-Excel-1

  • In this case, ungrouping the worksheet can fix filter function not working in Excel issue.
  • So come down to your worksheet and make a right-click on the sheet tab. After that choose the Ungroup Sheets option.

Ungroup-Selected-Worksheet-2

  • You will see, after making these changes again the filter option starts appearing.

Reason 9# The ‘Equals’ Filter Isn’t Working

While using the Equals filter, Number Filter, or Date Filter, if your Excel is not showing the right data then check whether the format of your data is the same or not.

Suppose, if you are having 2 cells and in each cell, you have entered 1000 as data. One cell is formatted in “currency” format and another one is formatted in “number” format. So when you make use of the “Number FiltersEquals” option, then Excel will only fetch the matches in which you have typed the number format also.

Only typing the text 1000 will search the match for the cells only in the number format. Whereas typing the text $1,000.00 will look for the cells which are formatted as ‘Currency’.

The same rule is also applicable in the case of dates. 16-Jan-19 and 16/01/2019 both are different. Thus make sure that the complete data column is formatted in the same format to avoid filter function not working in Excel issue.

Wrap Up:

The very first thing that Excel filters always check is whether your data matches well with its basic layout standards or not. If you are following all the Excel filters rules then you won’t get Excel filter not working issue.

So, take a close check whether you are following all the above mentioned Excel Filter rules correctly or not.

If none of the above fixes works to resolve your Excel Filter Not Working issue then ask about your queries on our Facebook and Twitter page.

Priyanka is an entrepreneur & content marketing expert. She writes tech blogs and has expertise in MS Office, Excel, and other tech subjects. Her distinctive art of presenting tech information in the easy-to-understand language is very impressive. When not writing, she loves unplanned travels.

Понравилась статья? Поделить с друзьями:
  • Excel filter not all columns
  • Excel filter from range
  • Excel filter from date to date
  • Excel filter column or column
  • Excel filter by color