In Excel: use =ISNUMBER(SEARCH("text",A2)) for a case-insensitive contains test, or wrap it in IF to return labels such as Yes and No.
Put the text to find in quotes or in a separate cell.
Use SEARCH for case-insensitive matching or FIND for case-sensitive matching.
Wrap with ISNUMBER to get TRUE/FALSE.
Wrap with IF when the sheet needs labels or categories.
What this does
Excel has no single CONTAINS function, so the common pattern is SEARCH inside ISNUMBER. SEARCH returns a position when the text is found and an error when it is not; ISNUMBER converts that into TRUE or FALSE. FIND is the case-sensitive alternative. Most people learn this as a sequence of clicks and forget it by next week; learning it as a pattern instead is what lets you apply it to the next, slightly different version of the problem without starting from scratch. That is the difference this page is trying to make. The difference between a quick fix and a sheet you can trust is the extra minute you spend validating “excel if contains text then”. Start on a copy or a tiny sample, keep the affected cells visible, and compare the result with the tool above before you touch the real workbook. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. The point is a workflow that saves repeating the same clicks every week, but the practical win is that someone else can open the file and understand what happened without asking you.
A worked example
A2 contains North-West Region. =ISNUMBER(SEARCH("west",A2)) returns TRUE because SEARCH ignores case. =IF(ISNUMBER(SEARCH("west",A2)),"West","Other") returns West for matching rows and Other for the rest. Contains formulas power tagging, routing, cleanup and exception reports where exact equality is too strict. One habit worth forming early: name the cells that hold your inputs, so the formula reads in plain language instead of a string of cell addresses. A reviewer — or you in three months — can then follow the logic without decoding what B7 and D2 were supposed to mean, which is most of what makes a sheet maintainable.
In Google Sheets
Everything above works in Google Sheets too. Excel and Sheets share the formula syntax used here; only the surrounding menus are arranged differently. That portability is deliberate — learn it once and it follows you between the two tools and across Windows and Mac. Keep this page bookmarked for the next time the same question comes up. Better still, rebuild the example once in your own sheet — doing it yourself, with the tool above to check against, is what turns a copied formula into a technique you own. If you take one thing from this page on “excel if contains text then”, make it the habit rather than the keystrokes: set the problem up with labelled inputs, reference those cells, and let Excel do the recomputing. Bookmark the page for the syntax, but do the example once in a blank sheet and check it against the tool above — five minutes of hands-on practice fixes the method in memory far better than re-reading, and it surfaces the small snags while they are still harmless. After that the technique is genuinely yours: faster than searching for it again, and reliable enough to drop into work that other people depend on.
Common mistakes
- Using equals when the cell contains more than just the target word.
- Forgetting that SEARCH is not case-sensitive.
- Letting
#VALUE!show instead of wrapping SEARCH inISNUMBER. - Hard-coding text in many formulas instead of referencing one criteria cell.
Frequently asked questions
Is there a CONTAINS function in Excel?
No. Use ISNUMBER with SEARCH or FIND.
How do I make the test case-sensitive?
Use FIND instead of SEARCH.
Can I return custom text?
Yes. Wrap the test in IF.