Table of Contents
The ability to filter datasets efficiently is fundamental to data analysis in Microsoft Excel. While standard AutoFilters handle basic equality checks with ease, situations often arise where you need to exclude records based on partial text matches. This is where the Advanced Filter feature, specifically utilizing the “Does Not Contain” logic, becomes indispensable. The “Does Not Contain” function is designed to swiftly identify and filter out any data row where a specified column contains the exact text or value defined in your criteria. This powerful capability allows analysts to focus on negative conditions—for instance, isolating all products that are not associated with a certain vendor, or identifying transactional records that do not mention a specific keyword.
Unlike simple filters which sometimes require complex helper columns or array formulas to achieve exclusion based on substrings, the Advanced Filter provides a streamlined, native solution. When deployed correctly, it ensures that your resulting dataset is pristine, containing only the records that strictly adhere to the exclusionary rule. This is particularly useful when dealing with messy or voluminous data where a quick visual inspection is insufficient, guaranteeing precision in your data refinement process. Mastering this technique elevates your Excel proficiency and greatly accelerates complex filtering tasks.
Understanding the “Does Not Contain” Syntax in Advanced Filter
To effectively communicate exclusion criteria to Excel’s Advanced Filter, a specific formula structure must be employed within the criteria range. This structure combines comparison operators and essential wildcard characters to define the parameters of the search. The fundamental syntax for telling Excel to look for cells that do not contain a specific string of text, regardless of where that string appears in the cell, is surprisingly concise.
You can use the following syntax to filter for rows that do not contain specific text in an Excel Advanced Filter:
<>*sometext*
This short expression carries significant meaning in the context of Excel’s filtering logic. The interpretation of this string relies heavily on the use of wildcard characters, specifically the asterisk (*), and the standard “not equal to” comparison operator. Understanding these components is key to mastering advanced criteria definitions.
The syntax breaks down into three critical parts. First, <> is the standard operator used in Excel to denote “not equal to.” When used in combination with wildcards, it signifies a logical exclusion. Second, the two asterisks (*) function as wildcard characters, representing any sequence of zero or more characters. By placing them before and after the text string (e.g., *sometext*), we instruct the filter to search for ‘sometext’ anywhere within the target cell. Finally, ‘sometext’ is the specific string we are attempting to locate and, in this case, exclude. Therefore, <>*sometext* translates to: “show me all rows where the corresponding cell value is not equal to any text sequence that contains ‘sometext’.”
Scenarios for Applying the Exclusion Criterion
The method used to apply this syntax depends on whether you are excluding a single term or multiple independent terms. We will explore two primary practical scenarios:
- Filter for rows that do not contain one specific text: This is a straightforward single-criterion exclusion, requiring a simple two-cell criteria range setup.
- Filter for rows that do not contain one of multiple text strings: This demands careful structuring of the criteria range to implement appropriate AND/OR logic for exclusion across the targeted field.
Example 1: Filtering for Rows that Do Not Contain One Specific Text
Let us begin by applying the “Does Not Contain” technique to a practical business dataset. Suppose we are managing sales records for a multi-regional company. Our goal is to analyze sales figures exclusively from regions other than the East. We need a filter mechanism that systematically excludes any record where the Region column explicitly contains the text “East”, ensuring a clean, focused subset of the original data.
Consider the following structure, which represents our source data, or the List Range. This dataset tracks the Product, Region, and Total Sales for several entries:
Suppose we have the following dataset that shows the total sales of certain products in certain regions for a company:

Our specific objective is to filter this list such that all records associated with the “East” region are hidden. To accomplish this using the Advanced Filter feature, we must first establish a dedicated criteria range—a separate area on the spreadsheet that tells Excel exactly which conditions to apply.
Defining the Criteria Range for Single Exclusion
The criteria range must mirror the header of the column being filtered, followed by the specific criterion directly underneath it. Since we are targeting the Region column, we copy that header (e.g., to cell F1). In the cell immediately below (F2), we input the exclusion formula derived from our standardized syntax: <>*East*. This setup ensures that Excel correctly applies the filter logic to the correct field.
Now suppose we’d like to filter for rows where the Region does not contain “East.” To do so, we can define a criteria range:

It is paramount that the header in the criteria range (F1 in this scenario) is an exact match for the corresponding header in the main dataset (C1). Any discrepancy, including extra spaces or incorrect capitalization (depending on version and settings), can cause the Advanced Filter to fail silently, returning unfiltered or incorrect results. The formula <>*East* acts as a single, powerful condition applied across the entire column.
Executing the Advanced Filter Operation
With the List Range (A1:C17) and the Criteria Range (F1:F2) properly defined, the next step is initiating the filtering process. Navigate to the Data tab on the Excel ribbon and locate the Sort & Filter group. Within this group, click the Advanced Filter button. This action launches the Advanced Filter dialog box, prompting the user to specify the input ranges.
Next, we can click the Data tab and then click the Advanced Filter button:

In the dialog box, ensure the correct options are selected. The default action is typically “Filter the list, in-place.” We then specify the two key ranges. The List range must encompass the entire dataset, including headers, which is A1:C17 in our example. The Criteria range is set to the area we prepared, F1:F2. This configuration directs Excel to check every row in A1:C17 against the condition defined in F2.
We’ll choose A1:C17 as the list range and F1:F2 as the criteria range:

Upon clicking OK, the dataset is immediately filtered. All rows where the Region column contained the string “East” are hidden, leaving only the data from the remaining regions (North, South, and West). This method provides a fast and reliable way to implement complex exclusionary logic without resorting to complex array formulas or iterative manual filtering.
Once we click OK, the dataset will be filtered to only show rows where the Region does not contain “East“:

Example 2: Excluding Rows That Contain Multiple Independent Text Strings
Often, data analysts need to apply exclusionary logic across several different criteria simultaneously. If we want to filter a dataset to exclude any entry that meets Condition A OR Condition B, we must utilize the specific logic of the Advanced Filter. This example demonstrates how to filter out rows that contain either “East” or “West” in the Region column, leaving only entries from the remaining regions (North and South).
We will continue to use the same sales dataset as in Example 1. It is essential to visualize the requirement: we need a row to be excluded if Region = *East* OR if Region = *West*. To achieve this overall exclusion, we must ensure that the row DOES NOT CONTAIN *East* AND DOES NOT CONTAIN *West*. This requires setting up an AND relationship between the two exclusion rules.

Structuring the Criteria Range for AND Exclusion
To implement the requirement that the Region must not contain “East” AND must not contain “West,” we set up the criteria range carefully. For the Advanced Filter to evaluate multiple criteria against the same column using AND logic, we must repeat the column header across multiple adjacent columns in the criteria area. This technique forces Excel to treat the conditions as mutually required.
Now suppose we’d like to filter for rows where the Region does not contain “East” or “West.” To do so, we can define a criteria range:

We create a header for Region in column F (F1) and another for Region in column G (G1). Under the first Region header (F2), we place the criteria <>*East*. Under the second Region header (G2), we place the criteria <>*West*. Because these criteria are on the same row (Row 2), Excel interprets this as an AND condition. The resulting filter will only show rows where the Region value DOES NOT CONTAIN “East” AND DOES NOT CONTAIN “West”. This setup ensures we exclude any row containing either of the specified terms.
Executing the Multi-Exclusion Filter
Once the specialized criteria range (F1:G2) is defined, the execution process follows the standard Advanced Filter steps. Access the Data tab, click the Advanced Filter button, and confirm the ranges. The List Range remains A1:C17. Crucially, the Criteria Range must be expanded to include the entire two-column criteria setup, encompassing F1:G2.
Next, we can click the Data tab and then click the Advanced Filter button.
We’ll choose A1:C17 as the list range and F1:G2 as the criteria range:

When the filter is applied, Excel processes the AND condition between F2 and G2. The filter successfully removes all entries associated with either of the unwanted regions, as any cell containing “East” would fail the G2 criteria, and any cell containing “West” would fail the F2 criteria. The remaining visible rows represent sales from only the North and South regions, achieving our goal of excluding both specified terms.
Once we click OK, the dataset will be filtered to only show rows where the Region does not contain “East” or “West“:

Best Practices for Complex Advanced Filter Criteria
When working with the Advanced Filter, especially when combining exclusion and inclusion rules, understanding the interaction between AND and OR logic is critical. Remember that criteria placed on the same row are interpreted as AND conditions (all must be true), while criteria placed on different rows are interpreted as OR conditions (any one must be true). For “Does Not Contain,” the AND logic (as shown in Example 2 via repeated headers) is necessary to exclude multiple independent text strings from the same field successfully.
Always ensure your criteria range is placed in an empty area of the worksheet, clearly separated from the main dataset. This prevents accidental inclusion of filter criteria within the data range, which could lead to filtering errors. Furthermore, the use of wildcard characters should be precise. If you use <>East* (without the leading asterisk), Excel would only exclude cells that start with “East” but do not contain any other characters before it, making the trailing asterisk redundant for partial matching.
A final important consideration is the maintenance of the criteria headers. They must be text values that exactly match the headers in the main data table. If your original header is formatted as a date, number, or contains non-standard characters, copying and pasting the header ensures fidelity. By strictly adhering to the syntax <>*text* and correctly applying AND/OR logic through row and column placement, the Advanced Filter becomes a robust tool for exclusionary data cleanup and analysis.
Summary of Key Takeaways
Mastering the “Does Not Contain” function within the Advanced Filter framework significantly enhances your ability to manipulate complex data structures in Excel. This technique is invaluable when standard AutoFilters lack the necessary flexibility for substring exclusion. The core strength lies in its simplicity and reliability, provided the criteria range is constructed correctly using the combination of the “not equal to” operator and the appropriate wildcard characters.
Remember these final points: <>*text* is the universal syntax for exclusion of a substring. To exclude multiple items (A or B), you must set up an AND condition (NOT A AND NOT B) using repeated headers on the same row in the criteria range. By integrating these precise techniques, you can ensure your data filtering processes are both accurate and efficient, regardless of the size or complexity of the underlying dataset.
Cite this article
stats writer (2025). How to Filter Data in Excel to Show Only Rows That Do Not Contain Specific Text. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-use-does-not-contain-in-excel-advanced-filter/
stats writer. "How to Filter Data in Excel to Show Only Rows That Do Not Contain Specific Text." PSYCHOLOGICAL SCALES, 30 Nov. 2025, https://scales.arabpsychology.com/stats/how-can-i-use-does-not-contain-in-excel-advanced-filter/.
stats writer. "How to Filter Data in Excel to Show Only Rows That Do Not Contain Specific Text." PSYCHOLOGICAL SCALES, 2025. https://scales.arabpsychology.com/stats/how-can-i-use-does-not-contain-in-excel-advanced-filter/.
stats writer (2025) 'How to Filter Data in Excel to Show Only Rows That Do Not Contain Specific Text', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-use-does-not-contain-in-excel-advanced-filter/.
[1] stats writer, "How to Filter Data in Excel to Show Only Rows That Do Not Contain Specific Text," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, November, 2025.
stats writer. How to Filter Data in Excel to Show Only Rows That Do Not Contain Specific Text. PSYCHOLOGICAL SCALES. 2025;vol(issue):pages.