Spreadsheet Practice

How to check if a cell contains specific text in Excel

Formula (Excel and Google Sheets)

=IF(ISNUMBER(SEARCH($E$1,A2)),"Yes","No")

Combine SEARCH with ISNUMBER inside IF: =IF(ISNUMBER(SEARCH(text,cell)),"Yes","No").

Result on the example
one result per row in B2, filled down to B7
Works in
Every current version
Google Sheets
Same formula

See it work

The formula is already in B2, filled down to B7. Change any input and the result updates, or edit the formula to experiment.

How it works

SEARCH returns the position of the text when it finds it and #VALUE! when it doesn't. ISNUMBER turns that into TRUE or FALSE, and IF picks the label. SEARCH ignores case, so "RUSH" and "Rush" both match.

Notice "No rush" also says Yes: the formula checks for the text, not its meaning.

=IF(ISNUMBER(SEARCH($E$1,A2)),"Yes","No")

Result"Yes"

  1. $E$1"rush"

    The value in E1.

  2. A2"Rush delivery please"

    The value in A2.

  3. SEARCH($E$1,A2)1

    SEARCH: Position of text, not case-sensitive, allows wildcards.

    • find_text$E$1"rush"
    • within_textA2"Rush delivery please"
  4. ISNUMBER(SEARCH($E$1,A2))TRUE

    ISNUMBER: TRUE if the value is a number.

    • valueSEARCH($E$1,A2)1
  5. IF(ISNUMBER(SEARCH($E$1,A2)),"Yes","No")"Yes"

    IF: Returns one value if a test is true, another if false.

    • logical_testISNUMBER(SEARCH($E$1,A2))TRUE
    • value_if_true"Yes"
    • value_if_false"No"not used

In Google Sheets

The same formula works in Google Sheets: =IF(ISNUMBER(SEARCH($E$1,A2)),"Yes","No"). We ran it in Google Sheets mode on the same data and it returns the same results.

Other ways to do it

Each one was run on the same example sheet.

FormulaResultWhen to use it
=IF(COUNTIF(A2,"*"&$E$1&"*"),"Yes","No")Yes, No, Yes…COUNTIF with wildcards returns 1 or 0, which IF treats as TRUE or FALSE.
=IF(ISNUMBER(FIND($E$1,A2)),"Yes","No")No, No, No…Different resultFIND is case-sensitive. Only exact-case "rush" matches, so "Rush" and "RUSH" say No.

Common mistakes

  • =IF(A2="*rush*",…) doesn't work: the = comparison doesn't understand wildcards. Only functions like COUNTIF and SEARCH do.
  • Short search words match inside longer words: "art" is found in "Start".

Try it yourself

Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.

Check if a cell contains specific text

In B2, show "Yes" when the note contains the word in E1 and "No" when it doesn't, then fill down to B7.

Questions

How do I check for one of several words?

Add the tests with OR: =IF(OR(ISNUMBER(SEARCH("rush",A2)),ISNUMBER(SEARCH("urgent",A2))),"Yes","No").

How do I return the cell itself instead of Yes?

Put the cell in the value_if_true argument: =IF(ISNUMBER(SEARCH($E$1,A2)),A2,"").

Checked by running on 2026-10-29: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.