How to Check Whether a Cell Contains Specific Text in Excel

Use ISNUMBER(SEARCH()) to find a word anywhere inside a cell — and route records by keyword.

You will learn to

  • Test whether a cell contains a word
  • Use a keyword stored in a cell
  • Check for any of several keywords

How it works

Excel has no CONTAINS function, but =ISNUMBER(SEARCH("refund",B2)) does the job. SEARCH returns the position of the text inside the cell, or #VALUE! if it is not there; ISNUMBER turns that into TRUE or FALSE. SEARCH ignores case, so "Refund", "REFUND" and "refund" all match.

Use FIND instead of SEARCH when case matters. To test several keywords, combine the checks with OR: =OR(ISNUMBER(SEARCH("refund",B2)),ISNUMBER(SEARCH("cancel",B2))). Keep keywords in cells so the rule can be changed without editing formulas.

=ISNUMBER(SEARCH("refund",B2))