Excel Filter Does Not Contain Text: How to Exclude Matches

Formulas & functions · Updated November 19, 2026

To show rows whose cells do not include particular text, open the column’s filter menu and choose Text Filters > Does Not Contain, then enter the text to exclude. Excel hides rows with a matching substring; it does not delete them, and the comparison is not case-sensitive.

How to apply “Does Not Contain” in Excel

In Excel for Microsoft 365 on Windows, click a cell in the data range, then select Data > Filter if filter arrows are not already visible. Open the arrow in the column you want to check and choose Text Filters > Does Not Contain. Enter the text to leave out and select OK.

For example, if a Description column contains product or location names, entering east excludes cells such as “East warehouse” and “Northeast depot.” It keeps rows such as “Central warehouse.” The filter applies to that column’s cell values, while hiding the corresponding entire rows so related information stays together.

For a formatted Excel table, filter arrows usually appear in the header row automatically. If the data is a plain range, make sure it has a header row and that the range is continuous; a blank row or column can cause Excel to identify only part of the intended data. On Mac, use Data > Filter and the column’s filter menu; the command names are substantially the same, though their placement can differ. Excel for the web also provides filter menus, but the layout may vary.

What “does not contain” actually checks

The criterion checks whether the entered text occurs anywhere in a cell, not whether the whole cell equals that text. If the criterion is car, a cell containing “carton” can be excluded as well as one containing “car.” This is useful when you need to remove a fragment, but it can be too broad if the letters appear inside unrelated words.

Text filtering is generally case-insensitive: excluding east also matches “East” or “EAST.” It does not remove or edit the underlying values. It only hides rows that meet the filter condition, so clearing the filter makes them visible again. This distinction matters before copying, totaling, or reviewing a filtered list: hidden rows still exist in the worksheet.

“Does Not Contain” is also different from “Does Not Equal.” The first excludes any cell containing the text as a substring; the second excludes cells equal to the specified value. To exclude only a category named “Returned,” for example, “Does Not Equal” may be more appropriate than “Does Not Contain,” which could also exclude “Returned for repair.”

Exclude more than one word

To leave out rows containing either of two terms, set both conditions in the Custom AutoFilter dialog and connect them with And. For example, choose Does Not Contain for the first condition and enter draft; choose Does Not Contain for the second and enter cancelled. With And, a row remains visible only if it contains neither term.

Use Or only when a row should remain visible if it meets either condition. In this particular case, “does not contain draft OR does not contain cancelled” can retain a row that contains one of the terms, so it usually does not express the goal of excluding both terms. For exclusions that must all be satisfied, And is the important choice.

For a longer list of exclusions, repeating conditions in the filter dialog becomes awkward. A helper column with a formula can make the rule easier to inspect and extend. With descriptions in A2:A100 and a helper column in B, enter this in B2 and fill it down:

=AND(ISERROR(SEARCH("draft",A2)),ISERROR(SEARCH("cancelled",A2)))

The formula returns TRUE when A2 contains neither word, and FALSE if it contains either. For example, “Draft invoice” returns FALSE, “Cancelled order” returns FALSE, and “Approved order” returns TRUE. Filter the helper column to TRUE. SEARCH is case-insensitive, and ISERROR turns the “text not found” result into a usable TRUE/FALSE test. A blank description also returns TRUE under this formula, so decide whether blank cells should remain in the results.

Blanks, spaces, and mixed data

A blank cell does not contain the text you entered, so it can remain visible in a “Does Not Contain” result. If you also want to remove blank cells, use the filter menu’s blank-value option where available, or apply a separate condition that excludes blanks. Check the result before relying on it: a cell that looks empty may contain a space or a formula returning an empty string, and those are not necessarily treated like a truly empty cell.

Leading or trailing spaces can also make data seem inconsistent. A cell that begins with a space still contains the word, so a substring filter can find it, but spaces may interfere with exact comparisons or make values look duplicated. If entries come from pasted or imported data, inspect representative cells and consider cleaning the source rather than trying to compensate with a more complicated filter.

Mixed columns can be harder to reason about because a column may contain text, numbers, dates, and blanks. Excel may show different filter options depending on the values and how it interprets them. If a text filter is missing, confirm that the target column contains text values and that you opened that column’s menu—not the menu for a neighboring numeric or date column. A numeric value stored as text can also behave differently from a true number in other types of filtering.

Wildcards and literal special characters

Excel’s text filter criteria can use wildcard characters. An asterisk (*) represents any sequence of characters, and a question mark (?) represents one character. That can be useful for a pattern-based filter, but it can surprise you if the text you want to exclude literally contains an asterisk or question mark. Excel uses a tilde (~) to escape wildcard characters when they should be treated literally.

For a straightforward phrase such as obsolete, enter the word without wildcard symbols. If the filter appears to match more values than expected, inspect the criterion for * or ? and consider whether Excel is interpreting it as a pattern. Also remember that a criterion such as net can match the letters inside a longer word. To avoid accidental substring matches, use a more distinctive phrase or choose a whole-value comparison when that fits the requirement.

Common reasons the results look wrong

  • The wrong column was filtered. Check the header above the dropdown you used and verify that the condition is attached to the intended field.
  • The filter covers only part of the data. Clear it, click inside the dataset, and check whether the filter arrows span all relevant headers. Converting a well-formed range to a table with Insert > Table can help keep the data range together.
  • The criterion is a substring. “Does Not Contain” can exclude a longer word that happens to include the text. Try a more specific phrase or use “Does Not Equal” for an exact-value rule.
  • Another column has an active filter. Excel combines filters across columns, so a row must satisfy the conditions in every filtered column to appear. Clear other column filters while diagnosing the result.
  • The source values have unexpected characters. Extra spaces, nonprinting characters, or inconsistent imported text may make entries look alike while differing internally. Inspect the cell contents and, if necessary, clean the data in a separate column.
  • The menu shows a search box rather than the rule you need. Searching in the dropdown list selects matching values; it is not the same as setting a “Does Not Contain” condition. Use Text Filters to define the rule.

Filter menu or helper column?

The built-in filter is usually the quickest option for a one-time review. It makes the condition visible in the column menu and does not add formulas or change cell values. It is also convenient when another person needs to inspect or clear the filter in the workbook.

A helper column is preferable when the exclusion logic is long, needs to be documented, or should update as the source data changes. It can also make a complex test easier to audit because each row displays a TRUE or FALSE result. The trade-off is that the formula must be copied through the data and the helper column must be maintained. For frequently refreshed workbooks, use a table so formulas and filters can expand with new rows.

Neither method removes records. If you intend to delete excluded rows, first verify the filtered results and consider saving a separate copy. Filtering and deletion are different operations, and deleting visible rows is a destructive change that is harder to reverse after the workbook is saved or closed.

Clear or change the filter

To restore the hidden rows, open the column’s filter menu and choose Clear Filter From followed by the column name, or use Data > Clear to clear filters across the current range. The exact command placement can vary slightly by platform. Clearing a filter does not erase the criterion from the cells because the criterion is not stored in the data.

To change the rule, reopen the menu and select Text Filters > Does Not Contain, then replace the criterion. If you need to temporarily see everything, clearing the filter is safer than editing or removing source values. When sharing a workbook, remember that a saved filter can affect what another person sees when they open it, even though the underlying rows remain present.

Frequently Asked Questions

Why is “Does Not Contain” missing from my Excel filter?
It is under the dropdown’s Text Filters submenu, and it may not appear when Excel treats the selected column as numeric or date data. Check that you opened the correct column menu and that the column contains text.

Does “Does Not Contain” ignore uppercase and lowercase?
Yes, Excel’s text filter is generally not case-sensitive. A criterion entered in lowercase can match the same letters in uppercase or mixed case.

Does Excel’s filter delete the rows that match?
No. It hides rows that do not meet the filter condition. Clear the filter to display them again; deleting rows is a separate action.

How do I exclude two words at once?
In the Custom AutoFilter dialog, set two “Does Not Contain” conditions and connect them with And. For several terms, a helper-column formula can be clearer than a long filter dialog.

Why does a blank row still appear?
A blank cell does not contain the text being excluded, so it can remain visible. A cell that only looks blank may contain spaces or a formula result, so inspect it if its behavior is unexpected.

Can I exclude an exact value instead of a partial match?
Yes. Choose Text Filters > Does Not Equal when you want to remove cells equal to a value, rather than cells containing that value as part of a longer string.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.