Skip to main content
ExcelFILTER with OR LogicLookupDynamic ArraysData AnalysisPlus Operator

The Problem

Have you ever found yourself staring at a sprawling spreadsheet, needing to extract specific rows that meet one of several conditions? Perhaps you need a list of all sales transactions for "Product A" OR "Product B," or all employees located in "New York" OR "London." Manually sorting, filtering, and copying these rows can quickly become a tedious, error-prone nightmare, especially with constantly updating data. You might try the traditional FILTER function but then get stuck trying to combine multiple criteria with the standard OR() function, only to find it doesn't quite work as expected.

What is FILTER? The FILTER function in Excel is a powerful dynamic array function that allows you to filter a range of data based on criteria you define, returning only the rows or columns that match. It is commonly used to extract subsets of data for reporting, analysis, or further processing, making your spreadsheets more dynamic and responsive. When you need to go beyond a single condition and include "OR" logic, understanding its specific syntax becomes crucial for true data mastery.

Business Context & Real-World Use Case

Imagine you're a Business Analyst at a large e-commerce company, responsible for weekly sales reporting. Your manager frequently requests custom views of the data. This week, she needs to see all sales generated by either your "Premium" customers OR transactions involving products from the "Electronics" category. Previously, this would involve applying a filter for "Premium" customers, copying the results, then clearing the filter, applying a new filter for "Electronics" products, copying those results, and finally consolidating them. This manual process is not only time-consuming but highly susceptible to human error—imagine accidentally missing a row or duplicating data.

In our experience as Excel consultants, we've seen teams waste countless hours on these repetitive filtering tasks. Beyond the time drain, manual methods introduce significant risks: inconsistent data, delayed reports, and ultimately, poor business decisions based on outdated or incorrect information. Automating this with the FILTER function using OR logic provides immediate business value. It ensures data accuracy, reduces report generation time from hours to seconds, and allows analysts to focus on interpreting insights rather than wrestling with data extraction. This agility means quicker responses to market changes and more robust decision-making.

The Ingredients: Understanding FILTER with OR Logic's Setup

To conquer multi-criteria filtering with OR logic using the FILTER function, you need to understand its specific syntax for combining conditions. Unlike some other Excel functions, FILTER uses arithmetic operators for boolean logic.

The essential syntax for applying OR logic within FILTER is:

=FILTER(array, (criteria1) + (criteria2))

Let's break down these critical ingredients:

Parameter Description
array This is the original range or table of data that you want to filter. It's your complete dataset, the "menu" from which you're selecting specific "dishes."
criteria1 This is the first logical test or condition that determines which rows or columns to include. It must be a range or array that evaluates to TRUE or FALSE for each row/column in your array. For example, [ColumnA]="ValueX".
+ (Plus Sign) This is the crucial element for OR logic. In boolean array operations, the plus sign acts as the OR operator. If criteria1 evaluates to TRUE (or 1) for a row OR criteria2 evaluates to TRUE (or 1) for the same row, then that row will be included in the filtered result. This means TRUE + TRUE is 1+1=2 (still TRUE), TRUE + FALSE is 1+0=1 (still TRUE), and FALSE + FALSE is 0+0=0 (FALSE).
criteria2 This is the second logical test or condition. Like criteria1, it should also be a range or array evaluating to TRUE or FALSE across your array. You can add more criteria using additional plus signs: (criteria1) + (criteria2) + (criteria3).

By wrapping each criterion in parentheses () you ensure that each logical test is evaluated independently before the + operator combines them. This is a subtle but important point for correct formula construction.

The Recipe: Step-by-Step Instructions

Let's walk through a practical example to see the FILTER function with OR logic in action. Imagine you have a sales dataset and you want to extract all transactions where the Product Category is "Electronics" OR the Region is "West."

Here's our sample data:

Table: Sales Data (A1:D8)

Order ID Product Category Region Sales Amount
1001 Clothing East 150
1002 Electronics West 750
1003 Home Goods Central 200
1004 Clothing West 300
1005 Electronics South 500
1006 Home Goods East 120
1007 Clothing Central 250

Our goal is to FILTER this data to show rows where "Product Category" is "Electronics" OR "Region" is "West".

1. Prepare Your Data:

Ensure your data is organized in a clear table or range. For this example, our data is in cells A1:D8. We will place our FILTER formula in an empty cell, for instance, F1.

2. Start the FILTER Function:

Click on cell F1 and begin typing the FILTER function. The first argument is your array, which is your entire dataset including headers.
=FILTER(A1:D8,

3. Define Your First Criterion:

Now, we'll add the first condition. We want Product Category to be "Electronics." This corresponds to column B.
=FILTER(A1:D8, (B1:B8="Electronics")

It's crucial to wrap this condition in parentheses. This tells Excel to evaluate this condition for every row in column B, returning an array of TRUE/FALSE values.

4. Introduce the OR Logic with the Plus Sign:

To add our "OR" condition, we use the + operator.
=FILTER(A1:D8, (B1:B8="Electronics") +

5. Define Your Second Criterion:

Next, specify the second condition: Region is "West." This is column C.
=FILTER(A1:D8, (B1:B8="Electronics") + (C1:C8="West"))

Again, wrap this second condition in its own set of parentheses.

6. Complete and Execute the Formula:

Your final formula should look like this:
=FILTER(A1:D8, (B1:B8="Electronics") + (C1:C8="West"))

Press Enter.

The Result:

The FILTER function will spill the results starting from cell F1, producing the following output:

Order ID Product Category Region Sales Amount
1002 Electronics West 750
1004 Clothing West 300
1005 Electronics South 500

Explanation of the Result:

  • Row 1002: Included because Product Category is "Electronics" (TRUE) AND Region is "West" (TRUE). (TRUE + TRUE = 1+1 = 2, which evaluates to TRUE).
  • Row 1004: Included because Product Category is "Clothing" (FALSE) BUT Region is "West" (TRUE). (FALSE + TRUE = 0+1 = 1, which evaluates to TRUE).
  • Row 1005: Included because Product Category is "Electronics" (TRUE) BUT Region is "South" (FALSE). (TRUE + FALSE = 1+0 = 1, which evaluates to TRUE).

This dynamic array formula instantly gives you a live, filtered view of your data, updating automatically if your source data changes. This is the power of FILTER with OR logic!

Pro Tips: Level Up Your Skills

Mastering the FILTER function with OR logic is a game-changer, but there are always ways to refine your technique and extract even more value.

  1. Use the plus (+) operator for OR conditions and the asterisk (*) operator for AND conditions to master dynamic array filtering. This is the bedrock of multi-criteria filtering with FILTER and other dynamic array functions. Remember: + means "either/or," * means "both/all."
  2. Referencing Criteria from Cells: Instead of hardcoding "Electronics" or "West" directly into your formula, experienced Excel users prefer to reference criteria from other cells. For example, if "Electronics" is in cell G1 and "West" is in H1, your formula would become: =FILTER(A1:D8, (B1:B8=G1) + (C1:C8=H1)). This makes your formula far more flexible; users can simply change the values in G1 or H1 to instantly update the filtered results without touching the formula itself.
  3. Handling No Matches: If your FILTER criteria result in no matches, the function will return a #CALC! error. To provide a more user-friendly output, use the optional [if_empty] argument. For instance: =FILTER(A1:D8, (B1:B8="NonExistent") + (C1:C8="Fake"), "No matching data found."). This will display the custom message instead of an error if no rows meet the conditions.
  4. Combining AND and OR Logic: You can nest + and * operators for highly complex filtering. For example, to find "Electronics" in "West" OR "Clothing" in "East": =FILTER(A1:D8, ((B1:B8="Electronics") * (C1:C8="West")) + ((B1:B8="Clothing") * (C1:C8="East"))). Parentheses are your best friend here for controlling the order of operations.

Troubleshooting: Common Errors & Fixes

Even the most seasoned Excel chefs occasionally encounter a snag. Here are some common issues when using the FILTER function with OR logic and how to resolve them gracefully.

1. Misusing the OR() Function Inside FILTER

  • What it looks like: Your FILTER function returns either the entire dataset (if OR() condition is met anywhere) or a #CALC! error, but not the row-by-row filtering you expect. The formula might look like: =FILTER(A1:D8, OR(B1:B8="Electronics", C1:C8="West")).
  • Why it happens: This is a very common mistake we've seen. The standard OR() function is designed to take multiple logical arguments and return a single TRUE or FALSE result. When you feed it an array like B1:B8="Electronics", it typically evaluates the first value in the array, or, in the context of a dynamic array function, it might collapse the entire array of conditions into a single TRUE or FALSE for the entire range. It does not produce an array of TRUE/FALSE values for each row, which is what FILTER expects for its include argument. This causes it to evaluate the whole array as a single TRUE/FALSE rather than row-by-row, leading to incorrect or error results.
  • How to fix it: The solution is to remember the best practice: Use the plus (+) operator for OR conditions directly within the FILTER function's include argument. Each condition should be a standalone array of TRUE/FALSE values, wrapped in its own parentheses, and then combined with +.
    • Step 1: Remove the OR() function entirely.
    • Step 2: Ensure each logical test (B1:B8="Electronics", C1:C8="West") is wrapped in its own set of parentheses.
    • Step 3: Join these parenthetical conditions with the + operator.
    • Corrected Formula: =FILTER(A1:D8, (B1:B8="Electronics") + (C1:C8="West"))

2. Referencing Mismatched Array Sizes

  • What it looks like: You might see a #VALUE! error or unexpected filtered results. Your formula could be something like =FILTER(A1:D8, (B1:B7="Electronics") + (C1:C8="West")).
  • Why it happens: The include argument(s) in FILTER (your criteria arrays) must have the same number of rows as the array you are trying to filter. If your main array is A1:D8 (8 rows), then both criteria1 and criteria2 must also span 8 rows (e.g., B1:B8 and C1:C8). If one of your criteria ranges, like B1:B7, is shorter or longer, Excel cannot correctly map the TRUE/FALSE values to each row in the primary array.
  • How to fix it:
    • Step 1: Carefully inspect your array argument (e.g., A1:D8) to determine its exact row count.
    • Step 2: Verify that all criteria ranges (e.g., B1:B8, C1:C8) precisely match the row count of your main array. Adjust any mismatched ranges.
    • Step 3: Re-enter or correct the formula with consistent ranges.
    • Example Fix: If B1:B7 was the error, change it to B1:B8.

3. Trailing Spaces or Inconsistent Text Case

  • What it looks like: The FILTER function runs without an error, but it fails to return expected rows, even though you know they exist in your data. For example, filtering for "Electronics" doesn't return any rows, yet you can visually see "Electronics" in the list.
  • Why it happens: Excel comparisons are exact. A cell containing "Electronics " (with a trailing space) is not equal to "Electronics." Similarly, "electronics" is not equal to "Electronics" unless you force case-insensitivity (which FILTER by default does not do). This often occurs due to manual data entry errors or imported data inconsistencies.
  • How to fix it:
    • Step 1 (Inspection): Visually check your source data for obvious discrepancies, extra spaces, or inconsistent capitalization.
    • Step 2 (Cleanup - Recommended): Use the TRIM function to remove leading/trailing spaces from your criteria range. For example, (TRIM(B1:B8)="Electronics"). You can also use UPPER or LOWER for case-insensitivity: (UPPER(B1:B8)=UPPER("Electronics")). For permanent cleanup, copy your data to a new column, apply TRIM or UPPER/LOWER, then paste as values.
    • Step 3 (Refine Criteria): Double-check that your criterion text in the formula (e.g., "Electronics") exactly matches the cleaned or expected text in your data.
    • Example Fix: Change (B1:B8="Electronics") to (TRIM(B1:B8)="Electronics") or (UPPER(B1:B8)=UPPER("Electronics")).

By understanding these potential pitfalls and applying these expert fixes, you'll be well on your way to mastering dynamic array filtering with OR logic.

Quick Reference

  • Syntax: =FILTER(array, (criteria1) + (criteria2), [if_empty])
  • Most Common Use Case: Extracting rows from a dataset that meet one of multiple specified conditions, e.g., "Show me all transactions for Product X OR Product Y."
  • Key Operator for OR: The + (plus) sign.
  • Key Operator for AND: The * (asterisk) sign.

Related Functions

👨‍💻

Written by The Head Chef

Former 10-year Financial Analyst who survived countless month-end closes. I build these recipes to save you from weekend-ruining spreadsheet errors.

Read the full story →

You might also find these useful 💡