Excel Formula Includes Text: How to Find Specific Words
In this article
To check if an Excel cell includes specific text, the most reliable method is combining the IF function with the SEARCH function. For example, the formula =IF(ISNUMBER(SEARCH("text", A1)), "Yes", "No") will return "Yes" if the specified text is found within cell A1 and "No" if it is not. This approach is the industry standard because SEARCH is not case-sensitive and can handle partial matches anywhere within the cell string.
What You'll Need
- A computer with Microsoft Excel installed (works across Windows, macOS, and Excel for the Web).
- A dataset containing text strings that you wish to analyze.
- Basic familiarity with entering formulas into the Excel formula bar.
Step-by-Step
- Identify your target cell and keyword: Determine which cell contains the text you want to scan (e.g., cell A2) and the specific word or phrase you are looking for (e.g., "Urgent").
- Start with the SEARCH function: The SEARCH function looks for one text string within another. In an empty cell, type
=SEARCH("Urgent", A2). If the word "Urgent" is found, Excel will return a number representing the character position where the word starts. If it is not found, it will return a #VALUE! error. - Wrap it in ISNUMBER: Because a #VALUE! error is difficult to use in a larger report, you need to convert that result into a simple TRUE or FALSE. Wrap your previous formula inside the ISNUMBER function:
=ISNUMBER(SEARCH("Urgent", A2)). Now, if the text is found, the cell displays TRUE; if not, it displays FALSE. - Add the IF function for custom results: To make the spreadsheet more readable for others, replace TRUE and FALSE with custom labels like "Found" and "Not Found". Use the IF function:
=IF(ISNUMBER(SEARCH("Urgent", A2)), "Found", "Not Found"). - Apply the formula to your entire list: Click the small green square (fill handle) at the bottom-right corner of the cell containing your formula and drag it down to apply the logic to all rows in your dataset.
- (Optional) Use a cell reference for the keyword: Instead of typing "Urgent" inside the formula, type the keyword in a separate cell (e.g., cell C1). Change your formula to
=IF(ISNUMBER(SEARCH(C1, A2)), "Found", "Not Found"). This allows you to change the keyword you are searching for without editing every single formula.
Common Mistakes
One of the most frequent errors is forgetting the quotation marks around the text string. In Excel formulas, any hard-coded text must be enclosed in double quotes (e.g., "Apple"). If you type SEARCH(Apple, A2) without quotes, Excel will think you are trying to reference a named range called "Apple" and will return a #NAME? error.
Another common mistake is confusing the SEARCH function with the FIND function. While they look similar, FIND is case-sensitive. If you use FIND to look for "urgent" but the cell contains "Urgent", FIND will return an error, whereas SEARCH will successfully find it. Unless you specifically need to distinguish between uppercase and lowercase letters, always use SEARCH.
Users also often forget to handle the #VALUE! error. If you use =IF(SEARCH("text", A2)="Yes", "Found", "No"), the formula will fail. This is because SEARCH does not return the word "Yes"; it returns a number. You must use ISNUMBER to translate that numeric position into a boolean value that the IF function can understand.
Tips
To search for multiple different keywords at once, you can use an array constant within the SEARCH function. For example, =SUMPRODUCT(--ISNUMBER(SEARCH({"Urgent","Immediate","ASAP", A2))) will return a number greater than 0 if any of those three words are present. This is significantly faster than writing three separate IF statements nested inside each other.
If you want to find text that is exactly a certain word and nothing else, do not use SEARCH. Instead, use the simple equals operator: =A2="Urgent". SEARCH is designed for "contains" logic (finding a needle in a haystack), while the equals sign is for "is exactly" logic.
For those working with very large datasets, consider using Conditional Formatting. Instead of creating a new column with a formula, select your data range, go to Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format, and enter =ISNUMBER(SEARCH("keyword", A1)). This will highlight the cells containing the text in a specific color, making them easier to spot visually without adding extra columns to your sheet.
Troubleshooting
If your formula is returning "Not Found" even though you can clearly see the text in the cell, check for hidden characters. Often, data imported from websites or other software contains "non-breaking spaces" or leading/trailing whitespace. To fix this, wrap your cell reference in the TRIM function: =IF(ISNUMBER(SEARCH("Urgent", TRIM(A2))), "Found", "Not Found"). The TRIM function removes extra spaces from the beginning and end of the text.
If you see a #NAME? error, double-check your spelling of the functions. Ensure you haven't typed "SEARCHING" instead of "SEARCH" or "ISNUMBERING" instead of "ISNUMBER". Also, ensure that all opening parentheses have a corresponding closing parenthesis at the end of the formula.
If the formula is returning a number (like 5 or 12) instead of "Found" or "Not Found", it means you have omitted the IF and ISNUMBER wrappers and are only using the SEARCH function. Remember that SEARCH only tells you where the text starts; it doesn't tell you if it exists in a way that is useful for a report.
Frequently Asked Questions
Can I search for a phrase instead of a single word?
Yes. The SEARCH function handles phrases exactly like single words. Just put the entire phrase in quotes, such as SEARCH("Project Update", A2). Excel will look for that exact sequence of characters, including the space between the words.
How do I search for text that is NOT included in a cell?
You can achieve this by wrapping the ISNUMBER function in a NOT function. The formula would look like =IF(NOT(ISNUMBER(SEARCH("text", A2))), "Not Found", "Found"). Alternatively, you can simply swap the "Found" and "Not Found" positions in your standard IF statement.
Does this work with wildcards?
Yes, the SEARCH function supports wildcards. The question mark (?) matches any single character, and the asterisk (*) matches any sequence of characters. For example, searching for "T*t" would find "Text", "Test", and "Treat".
Is there a way to do this without formulas?
Yes, you can use the Find and Replace tool (Ctrl + F) to locate text manually. If you need to filter a list, you can use the Filter dropdown on your column header, select Text Filters > Contains, and type your keyword there. This is faster for one-time checks but less permanent than a formula.
Can I search for text across multiple cells at once?
A single SEARCH formula only looks at one cell. To check if a keyword exists anywhere in a range (e.g., A2:A100), you can use =COUNTIF(A2:A100, "*keyword*"). If the result is greater than 0, the text exists somewhere in that range.
What happens if the cell is empty?
If the cell is empty, the SEARCH function will return a #VALUE! error. Because we wrap the SEARCH function in ISNUMBER, this error is converted to FALSE, and the IF function will correctly return your "Not Found" result without crashing the spreadsheet.