To test whether a cell contains a word or fragment — does this address include “TX,” does the note mention “urgent” — pair ISNUMBER with SEARCH. SEARCH finds the position; ISNUMBER turns “found” into a clean TRUE/FALSE.
The example
Flag rows whose description mentions “urgent” (case doesn’t matter).
| A | B | |
|---|---|---|
| 1 | Note | Urgent? |
| 2 | Please ship ASAP | FALSE |
| 3 | URGENT - call back | TRUE |
| 4 | urgent review needed | TRUE |
The formula
The contains test in B2:
How it works
Two functions team up:
SEARCH("urgent", A2)looks for "urgent" inside A2 and returns the character position where it starts — or a#VALUE!error if it’s not there.ISNUMBER(…)asks “did SEARCH return a number?” — TRUE if found, FALSE if it errored.- SEARCH is case-insensitive, so "URGENT", "Urgent", and "urgent" all match. Use FIND instead of SEARCH for a case-sensitive test.
- Wrap it in IF for a custom label:
=IF(ISNUMBER(SEARCH("urgent",A2)),"Flag","").
Try it: interactive demo
Type some text and a fragment to look for.
Variations
Case-sensitive contains
Swap SEARCH for FIND:
Return a label instead of TRUE/FALSE
Wrap in IF:
Contains via COUNTIF and wildcards
An alternative that reads naturally:
Pitfalls & errors
Don’t use SEARCH alone. =SEARCH("urgent", A2) returns a position number or an error, not TRUE/FALSE. ISNUMBER (or IFERROR) is what makes it a clean test.
SEARCH is case-insensitive; FIND is case-sensitive. Pick deliberately. SEARCH also supports wildcards (?, *); FIND does not.
Exact match is different. This tests “contains.” For “equals exactly,” use =A2="urgent" or EXACT for case sensitivity.
Practice workbook
Frequently asked questions
How do I check if a cell contains specific text in Excel?
How do I make the contains check case-sensitive?
How do I return a label instead of TRUE/FALSE?
Stop fighting formulas. Learn them in a day.
This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class