How to Search for Multiple Keywords at Once in Excel
Use SEARCH or FIND together with SUMPRODUCT, INDEX, and MATCH so that a single cell can check an entire column of keywords at once, determining whether a match exists and which keyword it is, and avoid false results caused by blank keywords and letter case.
Key Points of This Article
- Check whether a cell contains any one of the keywords in a keyword list: use SUMPRODUCT with ISNUMBER and SEARCH; a result greater than 0 means a hit.
- To find out which keyword was hit, use INDEX with MATCH to pull the first hit from the list.
- SEARCH is case-insensitive and supports wildcards, while FIND is case-sensitive, so FIND is safer when looking up by code.
- Blank cells in the keyword list will be treated as matching everything, so the formula needs a condition to exclude them.
- The formula only performs string matching, so the results should be spot-checked, especially for data that mixes numbers and abbreviations.
When organizing customer feedback, contract clauses, or product lists, you often need to check whether a piece of text contains any one of several words. For example, if a remark contains "refund," "complaint," or "delay," it should be highlighted in red. The Find dialog only handles one word at a time, so checking hundreds of rows one by one takes too long. To search for multiple keywords in an Excel sheet, you can list the keywords in a column and use a single formula to test every row at once.
This article is suited to readers who regularly work with text data, already know basic functions, but have not yet written multi-condition text matching formulas. After reading it, you will be able to build three types of formulas: checking whether a match occurs, returning the matched keyword, and filtering based on the match results. The examples below assume the keywords are in E2 to E6, and the text to be checked is in column A.
Which function formula to search for multiple keywords in an Excel table? One-sentence conclusion: use SEARCH to locate positions, then SUMPRODUCT to aggregate
First fix the keyword list in one column, then have SEARCH check each keyword's position within the cell one by one, use ISNUMBER to convert the found positions into TRUE or FALSE, and finally use SUMPRODUCT to add up the results. If the total is greater than 0, at least one keyword has been matched. The approaches for different requirements are as follows:
| Your situation | Recommended Practices | Cause |
|---|---|---|
| Just want to know whether any keyword is matched | =SUMPRODUCT(--ISNUMBER(SEARCH(E2:E6,A2)))>0 | A formula that returns TRUE or FALSE, useful for filtering |
| I want to know which keyword was matched | INDEX plus MATCH combination | Can directly display the keywords themselves, making them easy to count. |
| Keywords are case-sensitive, such as model numbers and codes | Replace SEARCH with FIND | FIND is case-sensitive, and it does not support wildcards. |
| Only require that the entire cell equals a certain keyword | =COUNTIF(E2:E6,A2)>0 | This is an exact match, not a contains match. Don't mix them up. |
| There are blank spaces in the keyword list. | Add the "is not empty" condition to the formula | Blank keywords match all text, causing every item to be hit. |
Before You Begin: Confirm These Points First
1. Whether the keyword is "contains" or "exactly matches". The SEARCH and FIND functions in a formula check whether a string of characters appears within the text, so "refund application" would also be matched by "refund". If you need the entire cell to match exactly, use COUNTIF instead. The two give different results, and choosing the wrong one will either miss data or count too much.
2. Does Case Matter? SEARCH is not case-sensitive, so typing "excel" will still find "Excel". This is usually convenient for English brand names and product models, but for codes where "AB12" and "ab12" must be distinguished, you should use FIND instead.
3. Whether the keyword contains wildcard characters. SEARCH treats the question mark and asterisk as wildcards, so the keyword "Q?" will match many cases such as "QA" and "Q1". If the keyword itself contains these two symbols, escape them by placing a tilde in front of them, or use FIND instead.
4. Is the keyword list clean? If the list contains blank cells, SEARCH treats an empty string as matching any text, so the entire column of data will be flagged as a hit. Before you start, check the length of the list and delete any extra blank rows.
5. Whether the data source can be copied directly. If the keywords or the text to be checked come from a PDF, the text must be selectable so it can be copied. Text in scanned documents cannot be selected directly; you must first run OCR to recognize it, and then paste the result into Excel. Otherwise, the formulas will not find anything.
Steps to Look Up by a Keyword List in Excel
- Create the keyword list. In column E, starting at E2, enter one keyword per row, for example "refund", "complaint", or "delay". Leave no blank rows between them. Keep the list to a few dozen items at most so it is easy to review.
- Select the result cell. Click cell B2, where the check formula will go. It tests whether A2 contains any keyword.
- Enter the check formula. Type =SUMPRODUCT(--ISNUMBER(SEARCH($E$2:$E$6,A2)))>0 and press Enter. A result of TRUE means a keyword was matched.
- Exclude blank keywords. If the list may contain empty cells, change the formula to =SUMPRODUCT(($E$2:$E$6<>"")*ISNUMBER(SEARCH($E$2:$E$6,A2)))>0 so that only non-empty keywords are counted.
- Return the matched keyword. In C2, enter =IFERROR(INDEX($E$2:$E$6,MATCH(1,INDEX(($E$2:$E$6<>"")*ISNUMBER(SEARCH($E$2:$E$6,A2)),0),0)),"Not Found"). The result shows the first keyword in the list that matches.
- Fill down. Select B2 and C2, then drag the fill handle in the bottom-right corner down to the last row of data so that all rows are calculated at once.
- Replace the function if case sensitivity matters. Change SEARCH to FIND in the formulas and keep the rest of the structure the same. Then check again that the results are as expected.
Verify each item after completion
After the formula produces its results, do not use them directly for statistics; first check each item one by one.
| Checklist items | How should I look at it? | What should I do if I have a problem? |
|---|---|---|
| Is the number of hits reasonable? | Manually compare dozens of rows of data and judge whether the results are consistent. | Check whether the keyword contains spaces, punctuation, or full-width characters |
| Does "full hit" occur? | If almost every row is TRUE, first check whether there are blank cells in the keyword list. | Add the "not empty" condition, then refill the formula |
| Is the case (upper/lower) being misjudged? | Select a few records with differing letter case and compare them. | Use FIND when a distinction is needed. |
| Does the wildcard match incorrectly? | View keyword hit results that contain question marks or asterisks | Add a tilde before the symbol, or use FIND instead. |
| Is the returned keyword correct? | Check whether column C matches the judgment in column B, and whether "no match" is displayed when there is no match. | If the order of the list affects the result, adjust the order of the keywords, or switch to a counting method. |
| Is the data in the scanned document recognized accurately? | Spot-check the lines containing the key terms against the original file. | First run OCR on the PDF, then manually check the recognition results, since both OCR and machine translation can make mistakes. |
📊 Core Comparison
There are three common ways of making judgments in practical work, each suited to different scenarios:
| Method | Suitable scenarios | Notes |
|---|---|---|
| SUMPRODUCT plus SEARCH | Contains match, case-insensitive, e.g., "a certain word appears in the notes" | When a keyword contains a question mark or an asterisk, it is treated as a wildcard. |
| SUMPRODUCT plus FIND | Case sensitivity or encoding handling is needed, such as for model numbers and product codes | Wildcards are not supported; matching is stricter. |
| COUNTIF | Exact whole-string matching: simple to write and fast to compute. | Cannot recognize cases where keywords are embedded in the middle of a sentence. |
If you're not sure which one to use, you can first try each on a small sample of data (for example, ten rows), and check whether the results match your manual judgment before applying it to the whole table.
❓ Frequently Asked Questions (FAQ)
1. If there are more than one hundred keywords, can the formula still be used?
It can be used, but be mindful of the computational load. The more keywords and data rows there are, the slower SUMPRODUCT calculates. A safer approach is to group the keywords and write several separate formulas, or to store lists you use long-term on a separate worksheet.
2. How do I keep only the rows that match from the query results?
After adding the result in the judgment column, select the header row and use the "Filter" feature to display only the rows where the result is TRUE. This way, the original data does not need to be changed, and checking and copying are both convenient.
3. Why do formulas show different results on someone else's computer?
Most of the time this comes from differences in the keyword list's whitespace, letter case settings, or the regional list separator. Sending the list together with the sample data to the other party, and stating the criteria used to judge a match, can reduce these discrepancies.
4. Keywords are in the PDF — how do I get them into Excel?
If the PDF is a digital version with selectable text, you can simply copy and paste it directly. For scanned PDFs, you need to run OCR first and then copy. The PDF editor in the OmniDoc desktop client supports OCR, and you can also export a PDF to Excel and then process it with the formulas mentioned above. After exporting, be sure to check the content as well. The desktop client can be downloaded at download.omnidoc.top.
5. Can all matched keywords be listed at once?
Using the formula above only returns the first matching item. To list all matching items, you can try the TEXTJOIN combined with IF approach in Excel 365, or add a separate judgment column for each keyword, which is more intuitive and makes later statistics easier.
📝 Summary
Searching for multiple keywords in an Excel sheet comes down to three steps: put the keywords in one column, use SUMPRODUCT with SEARCH to check whether each cell contains a hit, and use INDEX with MATCH to pull out the specific keyword. Before writing the formula, confirm whether you need "contains" or "exact match," whether case matters, and whether there are stray spaces in the cells. After you get results, spot-check a sample to verify them, and then you can use them for statistics with confidence.


