Excel COUNT IF Contains Text

“excel count if contains text” comes up constantly, so this page leads with the exact answer, and only then explains the detail. Everything works in Excel on Windows and Mac and maps almost one-to-one to Google Sheets. Copy the answer above and get back to work, or read on to turn a one-off fix into something you never have to look up again.

Exact answer

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.

Annotated stepsExcel
1

Put the text to find in quotes or in a separate cell.

2

Use SEARCH for case-insensitive matching or FIND for case-sensitive matching.

3

Wrap with ISNUMBER to get TRUE/FALSE.

4

Wrap with IF when the sheet needs labels or categories.

=ISNUMBER(SEARCH("text",A2))
Ctrl+CthenCtrl+Shift+V+Cthen+Ctrl+VPaste values · WindowsMac

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. The same idea underpins a lot of everyday Excel work, so the few minutes spent getting it right here pay back across every sheet you build afterwards. Treat it as a pattern, not a one-off, and it stops being something you look up and starts being something you reach for. The difference between a quick fix and a sheet you can trust is the extra minute you spend validating “excel count if contains text”. 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

Google Sheets handles this almost identically to Excel. The formula syntax above is the same, and the menu lives under a slightly different label rather than a ribbon tab. Use the platform toggle at the top of the page to switch every keyboard shortcut between Windows and Mac, and expect at most cosmetic differences in naming. 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 count if contains text”, 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 in ISNUMBER.
  • 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.