Excel does not have a built-in "does not contain" button within the standard Find and Replace dialog box. To achieve this, you must use a Filter, a formula (like SEARCH or FIND combined with ISERROR), or Conditional Formatting to isolate the cells that lack your specific keyword. These methods allow you to identify gaps in your data, find missing entries, or clean up lists by removing rows that contain unwanted terms.
What You'll Need
- Microsoft Excel (Desktop version recommended for full filter functionality).
- A dataset with a column of text you wish to analyze.
- A clear understanding of the specific text string you are looking to exclude.
Step-by-Step
Depending on whether you want to simply hide the data, mark it in a new column, or highlight it visually, choose one of the following three methods. Note that menu labels may differ slightly based on your version of Excel or regional settings.
Method 1: Using Text Filters (The Fastest Way)
This is the most direct way to hide rows that contain a specific word, effectively leaving you with only the cells that "do not contain" that text.
- Click anywhere inside your data range or table.
- Go to the Data tab on the top ribbon and click the Filter button. You will now see drop-down arrows in the header of each column.
- Click the drop-down arrow in the column you want to search.
- Hover your mouse over Text Filters in the menu.
- From the side menu that appears, select Does Not Contain....
- A dialog box will open. In the text box next to "does not contain," type the exact word or phrase you want to exclude.
- Click OK. Excel will now hide all rows that contain that specific text, showing only the cells that do not.
Method 2: Using a Helper Column with Formulas (The Most Flexible Way)
If you need to perform further calculations on the data that does not contain your keyword, creating a "True/False" helper column is the best approach. We use the SEARCH function because it is not case-sensitive.
- Insert a new blank column next to your data. Label it "Does Not Contain?"
- In the first cell of this new column (e.g., cell B2), enter the following formula:
=ISERROR(SEARCH("yourtext", A2)). Replace"yourtext"with the word you are looking for andA2with the cell containing the text you are checking. - Press Enter. The formula works by trying to find the text; if the text is NOT found,
SEARCHreturns an error. TheISERRORfunction then turns that error into a TRUE value. - If the cell does not contain the text, the result will be TRUE. If it does contain the text, the result will be FALSE.
- Hover your mouse over the bottom-right corner of the cell until you see a small black cross (the fill handle), then double-click or drag it down to apply the formula to the rest of your list.
- You can now use a standard filter on this helper column to show only the TRUE values.
Method 3: Using Conditional Formatting (The Visual Way)
Use this method if you want to keep all your data visible but want to highlight every cell that does not contain a specific word.
- Select the range of cells you want to check.
- Go to the Home tab, click Conditional Formatting, and select New Rule....
- Select the option Use a formula to determine which cells to format.
- In the formula box, enter:
=ISERROR(SEARCH("yourtext", A2)). Ensure thatA2refers to the top-leftmost cell of your selected range. - Click the Format... button. Choose a fill color (like light red or yellow) from the Fill tab to make the cells stand out.
- Click OK and then OK again. All cells that do not contain the specified text will now be highlighted.
Common Mistakes
- Confusing SEARCH and FIND: Many users use
FINDinstead ofSEARCH.FINDis case-sensitive (it treats "Apple" and "apple" as different words), whereasSEARCHis not. If your search isn't returning the expected results, check your capitalization or switch toSEARCH. - Incorrect Range Referencing: When using Conditional Formatting, users often select a whole column but write the formula for a specific cell (like
$A$2). Using absolute references (the dollar signs) locks the formula to one cell. Always use a relative reference (likeA2) so Excel checks every row individually. - Including Extra Spaces: If you type " word " (with spaces) into the filter or formula, Excel will only exclude cells that have those exact spaces. Be careful not to add leading or trailing spaces in your search term.
- Applying Filters to Empty Cells: If your column has blank cells, the "Does Not Contain" filter will usually include them in the results because a blank cell technically does not contain the text. If you want to exclude blanks too, you must add a second filter criteria using the "And" operator.
Tips
- Using Wildcards: In the Text Filter menu, you can use the asterisk (
*) as a wildcard. For example, searching for*east*will find any cell that has "east" anywhere in the string, though "Does Not Contain" already handles this behavior by default. - Combining Criteria: In the "Custom AutoFilter" dialog (Method 1), you can set two rules. For example, you can set it to "Does Not Contain 'Paid'" AND "Does Not Contain 'Pending'" to find only the truly empty or unrelated records.
- Dynamic Search: Instead of typing the text directly into a formula, point the formula to a cell (e.g.,
=ISERROR(SEARCH($E$1, A2))). Now, whenever you change the text in cell E1, your entire list will update automatically to show what does not contain that new word. - Converting to Table: Convert your data range into an official Excel Table (Ctrl + T). This ensures that when you add new rows to the bottom of your list, your helper formulas and conditional formatting rules extend automatically to the new data.
Troubleshooting
If your "does not contain" logic isn't working, try these steps in order:
- Check for Hidden Characters: Sometimes data imported from the web contains non-breaking spaces or hidden characters. Try using the
TRIMfunction on your data first to remove unnecessary spaces. - Verify Data Types: Ensure the column is formatted as "General" or "Text." If a cell is formatted as a Number or Date, the
SEARCHfunction may behave unexpectedly. - Refresh the Filter: If you have changed the data in your cells, the filter will not update automatically. Go to the Data tab and click Reapply to update the visible rows.
- Check Formula Syntax: Ensure your search term is enclosed in double quotation marks (
"text"). Forgetting the quotes will cause Excel to return a#NAME?error because it thinks you are referring to a named range. - Test with a Simple Word: If a complex phrase isn't working, try searching for a single letter. If that works, the issue is likely a typo or a hidden character in your original long search phrase.
Frequently Asked Questions
Can I use the Ctrl+F Find window to do this?
No. The standard Find (Ctrl+F) and Replace (Ctrl+H) tools are designed only to locate cells that do contain a specific value. They cannot isolate cells that lack a value.
Does this work for numbers as well as text?
Yes, but the SEARCH and FIND functions treat numbers as text strings. If you are looking for a specific digit within a larger number, these methods work perfectly.
How do I permanently delete the rows that contain the text?
The safest way is to use the "Does Not Contain" filter to show what you want to keep, copy those results to a new sheet, and delete the old sheet. Alternatively, filter for "Contains," select all visible rows, right-click, and choose Delete Row.
Is there a difference between "Does Not Equal" and "Does Not Contain"?
Yes. "Does Not Equal" looks for an exact match of the entire cell. If a cell says "Red Apple," a "Does Not Equal Red" filter will still show that cell because the whole cell is not exactly "Red." "Does Not Contain" will hide it because the word "Red" is found anywhere inside the cell.
Can I use this across multiple columns at once?
The standard filter only works one column at a time. To check multiple columns, use a helper column with an OR logic formula, such as =ISERROR(SEARCH("text", A2)) * ISERROR(SEARCH("text", B2)), which returns 1 only if the text is missing from both columns.