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

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").

**Excel:** `=IF(COUNT(SEARCH($D$2:$D$3,A2))=ROWS($D$2:$D$3),"Yes","No")` (Every current version)

**Google Sheets:** `=IF(SUMPRODUCT(--ISNUMBER(SEARCH($D$2:$D$3,A2)))=ROWS($D$2:$D$3),"Yes","No")`

## Example

Sample data (row 1 is the header):

| A | B | C | D |
| --- | --- | --- | --- |
| Listing | Matches all? |  | Must include |
| Oak standing desk, 140 cm |  |  | oak |
| Walnut standing desk |  |  | desk |
| Oak desk lamp |  |  |  |
| Standing oak desk with drawer |  |  |  |
| Oak bookshelf |  |  |  |

Formula in B2, filled to B6: `=IF(COUNT(SEARCH($D$2:$D$3,A2))=ROWS($D$2:$D$3),"Yes","No")`

Result: Yes; No; Yes; Yes; No

## 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.

## Other ways

- `=IF(AND(ISNUMBER(SEARCH($D$2:$D$3,A2))),"Yes","No")`: 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.

## 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`.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/check-if-cell-contains-all-of-several-words
