Check if a Cell Contains Specific Text

Excel Formulas › Information

All versionsISNUMBERSEARCH

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.


Quick formula: to test whether A2 contains the text in B2:
=ISNUMBER(SEARCH(B2, A2))
SEARCH returns a number (the position) if found, or an error if not; ISNUMBER converts that to TRUE/FALSE.

Functions used (tap for the full reference guide):

The example

Flag rows whose description mentions “urgent” (case doesn’t matter).

AB
1NoteUrgent?
2Please ship ASAPFALSE
3URGENT - call backTRUE
4urgent review neededTRUE

The formula

The contains test in B2:

=ISNUMBER(SEARCH("urgent", A2)) // found anywhere → TRUE

How it works

Two functions team up:

  1. 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.
  2. ISNUMBER(…) asks “did SEARCH return a number?” — TRUE if found, FALSE if it errored.
  3. SEARCH is case-insensitive, so "URGENT", "Urgent", and "urgent" all match. Use FIND instead of SEARCH for a case-sensitive test.
  4. Wrap it in IF for a custom label: =IF(ISNUMBER(SEARCH("urgent",A2)),"Flag","").

Try it: interactive demo

Live demo

Type some text and a fragment to look for.

Result:

Variations

Case-sensitive contains

Swap SEARCH for FIND:

=ISNUMBER(FIND("TX", A2))

Return a label instead of TRUE/FALSE

Wrap in IF:

=IF(ISNUMBER(SEARCH("urgent", A2)), "Flag", "")

Contains via COUNTIF and wildcards

An alternative that reads naturally:

=COUNTIF(A2, "*urgent*")>0

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

📊
Download the free Check if a Cell Contains Specific Text practice workbook
The notes list with live ISNUMBER(SEARCH()), the case-sensitive FIND and COUNTIF wildcard versions, plus 4 challenges with answers. No sign-up required.

Frequently asked questions

How do I check if a cell contains specific text in Excel?
Use =ISNUMBER(SEARCH("text", A2)). SEARCH returns the position if the text is found, and ISNUMBER converts that to TRUE or FALSE. SEARCH is case-insensitive.
How do I make the contains check case-sensitive?
Replace SEARCH with FIND: =ISNUMBER(FIND("TX", A2)). FIND is case-sensitive, so it distinguishes TX from tx.
How do I return a label instead of TRUE/FALSE?
Wrap the test in IF: =IF(ISNUMBER(SEARCH("urgent", A2)), "Flag", "") shows Flag when the text is present and a blank otherwise.

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

Related formulas: Catch errors with IFERROR · Count cells that contain text · Clean up messy text

Function references: ISNUMBER · SEARCH · COUNTIF