Spreadsheet Practice

How to check if a cell contains all of several words in Excel

Excel formula

=IF(COUNT(SEARCH($D$2:$D$3,A2))=ROWS($D$2:$D$3),"Yes","No")

Count how many of the words are found and compare with the number of words: =IF(COUNT(SEARCH($D$2:$D$3,A2))=ROWS($D$2:$D$3),"Yes","No").

Result on the example
one result per row in B2, filled down to B6
Works in
Every current version
Google Sheets
Different formula, see below

See it work

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

How it works

SEARCH returns a position for each word it finds and an error for each one it doesn't. COUNT counts only the numbers, so it is the number of words found. When that equals the number of words in the list (ROWS), every word is there.

=IF(COUNT(SEARCH($D$2:$D$3,A2))=ROWS($D$2:$D$3),"Yes","No")

Result"Yes"

  1. $D$2:$D$32 rows × 1 col: "oak", "desk"

    A range: 2 cells in one column.

  2. A2"Oak standing desk, 140 cm"

    The value in A2.

  3. SEARCH($D$2:$D$3,A2){2 rows × 1 col} 1, 14

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

    • find_text$D$2:$D$32 rows × 1 col: "oak", "desk"
    • within_textA2"Oak standing desk, 140 cm"
  4. COUNT(SEARCH($D$2:$D$3,A2))2

    COUNT: Counts cells that contain numbers.

    • value1SEARCH($D$2:$D$3,A2){2 rows × 1 col} 1, 14
  5. ROWS($D$2:$D$3)2

    ROWS: Number of rows in a range.

    • array$D$2:$D$32 rows × 1 col: "oak", "desk"
  6. COUNT(SEARCH($D$2:$D$3,A2))=ROWS($D$2:$D$3)TRUE

    The = operator tests whether the two sides are equal.

  7. IF(COUNT(SEARCH($D$2:$D$3,A2))=ROWS($D$2:$D$3),"Yes","No")"Yes"

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

    • logical_testCOUNT(SEARCH($D$2:$D$3,A2))=ROWS($D$2:$D$3)TRUE
    • value_if_true"Yes"
    • value_if_false"No"not used

In Google Sheets

Google Sheets needs a different formula: =IF(SUMPRODUCT(--ISNUMBER(SEARCH($D$2:$D$3,A2)))=ROWS($D$2:$D$3),"Yes","No"). On the same data it gives the same result. Here it is running in Google Sheets mode.

Other ways to do it

Each one was run on the same example sheet.

FormulaResultWhen to use it
=IF(AND(ISNUMBER(SEARCH($D$2:$D$3,A2))),"Yes","No")Yes, No, Yes…Excel 365: AND is TRUE only if every keyword was found.

Common mistakes

  • Words match inside longer words: "oak" is found in "soaked". Add spaces around the words if that matters.
  • In Google Sheets, COUNT(SEARCH(range,…)) needs ARRAYFORMULA; the SUMPRODUCT version works without it.

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 all of several words

In B2, show "Yes" only when the listing contains every word in D2:D3, and "No" otherwise. Fill down to B6.

Questions

How do I check for any of the words instead?

Test for more than zero: =IF(COUNT(SEARCH($D$2:$D$3,A2))>0,"Yes","No").

How do I require at least two of three words?

Compare with 2: =COUNT(SEARCH($D$2:$D$4,A2))>=2.

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