How to Check if a Cell Contains Specific Text in Google Sheets
Use =ISNUMBER(SEARCH("total",A2)) to return TRUE when the cell contains the word. SEARCH ignores case; FIND is case-sensitive.
=ISNUMBER(SEARCH("total",A2))
SEARCH returns the position if found; ISNUMBER turns that into TRUE, or FALSE when not found.
How it works
SEARCH looks for a substring and returns its position, or an error if it's absent. Wrapping it in ISNUMBER converts a found position into TRUE and the error into FALSE. SEARCH is case-insensitive; swap in FIND for a case-sensitive test. Combine with IF to output your own labels instead of TRUE/FALSE.
Variations
Return Yes or No
=IF(ISNUMBER(SEARCH("total",A2)),"Yes","No")
IF turns the TRUE/FALSE into readable text.
Case-sensitive match
=ISNUMBER(FIND("Total",A2))
FIND distinguishes Total from total.
Match the text in another cell
=ISNUMBER(SEARCH(B2,A2))
Looks for whatever word is typed in B2.
Examples
| Scenario | Formula |
|---|---|
| Flag rows mentioning refund | =IF(ISNUMBER(SEARCH("refund",A2)),"Yes","No") |
| Does the note contain a code word? | =ISNUMBER(SEARCH(B2,A2)) |
FAQ
What is the difference between SEARCH and FIND?
SEARCH ignores case and supports wildcards; FIND is case-sensitive and literal.
Why does my formula return an error instead of FALSE?
SEARCH alone errors when the text is missing. Wrap it in ISNUMBER so missing becomes FALSE.
How do I show Yes/No instead of TRUE/FALSE?
Wrap it in IF: =IF(ISNUMBER(SEARCH("total",A2)),"Yes","No").
Related formulas
- How to Calculate a Running Total in Google Sheets
- How to Calculate Age From a Birthday in Google Sheets
- How to Convert Text to Numbers in Google Sheets
- How to Count Days Between Two Dates in Google Sheets
- How to Extract Numbers From Text in Google Sheets
- How to Sum If a Cell Contains Specific Text in Google Sheets
- How to Calculate Percentage of a Total in Google Sheets
- How to Combine Two Columns in Google Sheets