## How to check if cell contains one of several values in Excel?

Supposing, you have a list of text strings in column A, now, you want to test each cell if it contains one of several values based on another range D2:D7. If it contains any of the specific text in D2:D7, it will display True, otherwise, it will show False as following screenshot shown. This article, I will talk about how to identify a cell if it contains one of several values in another range.

#### Check if a cell contains one of several values from a list with formulas

To check if a cell content contains any one of the text values in another range, the following formulas may help you, please do as this:

Enter the below formula into a blank cell where you want to locate the result, B2, for instance, then drag the fill handle down to the cells that you want to apply this formula, and if the cell has any of the text values in another specific range, it will get True, otherwise, it will get False. See screenshot:

=SUMPRODUCT(--ISNUMBER(SEARCH(\$D\$2:\$D\$7,A2)))>0

Tips:

1. If you would like use “Yes” or “No’ to indicate the result, please apply the following formula, and you will get the following result as you need, see screenshot:

=IF(SUMPRODUCT(--ISNUMBER(SEARCH(\$D\$2:\$D\$6,A2))),"Yes","No")

2. In the above formulas, D2:D7 is the specific data range which you want to check the cell based on, and A2 is the cell that you want to check.

#### Display the matches if cell contains one of several values from a list with formulas

Sotimes, you may want to check if a cell contains a value in the list and then returns that value, if multiple values match then all matching values in the list are displayed as below screenshot shown.How could you solve this task in Excel?

To display all matching vaues if the cell contains one of the specific text, please apply the below formula:

=TEXTJOIN(", ", TRUE, IF(COUNTIF(A2, "*"&\$D\$2:\$D\$7&"*"), \$D\$2:\$D\$7, ""))

Note: In the above formula, D2:D7 is the specific data range which you want to check the cell based on, and A2 is the cell that you want to check.

Then, press Ctrl + Shift + Enter keys together to get the first result, and then drag the fill handle down to the cells that you want to apply this formula, see screenshot:

Tips:

The above TEXTJOIN function only available for Excel 2019 and Office 365, if you have earlier Excel versions, you should apply the below formula:

=IFERROR(INDEX(\$D\$2:\$D\$7, SMALL(IF(COUNTIF(\$A2, "*"&\$D\$2:\$D\$7&"*"), MATCH(ROW(\$D\$2:\$D\$7), ROW(\$D\$2:\$D\$7)), ""), COLUMNS(\$F\$1:F1))), "")

Note: In the above formula, D2:D7 is the specific data range which you want to check the cell based on, and A2 is the cell that you want to check.

Then, press Ctrl + Shift + Enter keys together to get the first result, and then drag the formula cell to right side until blank cell is displayed, and then go on dragging the fill handle down to other cells, and all matching values have been displayed as below screenshot shown:

#### Highlight the matches if cell contains one of several values from a list with a handy feature

If you want to highlight a specific font color for the matching values if cell contains one of several values from another list, this section, I will introduce an easy feature, Mark Keyword of Kutools for Excel, with this utility, you can highlight the specific one or more keywords at once within the cells.

Note:To apply these Mark Keyword features, firstly, you should download the Kutools for Excel, and then apply the features quickly and easily.

After installing Kutools for Excel, please do as follows:

1. Click Kutools > Text > Mark Keyword, see screenshot:

2. In the Mark Keyword dialog box, please do the following operations:

• Select the data range that you want to highlight the matching texts from the Range textbox;
• Select the cells contains the keywords that you want to highlight based on, you can also enter the keywords manually (separate by comma) into the Keyword text box
• At last, you should specify a font color for highlighting the texts by check Mark keyword colors option.

3. Then, click Ok button, all matching texts have been highlighted as below screenshot shown:

#### More relative articles:

• Compare Two Or More Text Strings In Excel
• If you want to compare two or more text strings in a worksheet with case sensitive or not case sensitive as following screenshot shown, this article, I will talk about some useful formulas for you to deal with this task in Excel.
• If Cell Contains Text Then Display In Excel
• If you have a list of text strings in column A, and a row of keywords, now, you need to check if the keywords are appear in the text string. If the keywords appear in the cell, displaying it, if not, blank cell is displayed as following screenshot shown.
• Count Keywords Cell Contains Based On A List
• If you want to count the number of keywords appears in a cell based on a list of cells, the combination of the SUMPRODUCT, ISNUMBER and SEARCH functions may help you to solve this problem in Excel.
• Find And Replace Multiple Values In Excel
• Normally, the Find and Replace feature can help you to find a specific text and replace it with another one, but, sometimes, you may need to find and replace multiple values simultaneously. For example, to replace all “Excel” text to “Excel 2019”, “Outlook” to “Outlook2019” and so on as below screenshot shown. This article, I will introduce a formula for solving this task in Excel.

### Best Office Productivity Tools

 🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions… Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ... Super Lookup: Multiple Criteria VLookup  |   Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup .... Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List .... Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ... Featured Features: Grid Focus   |  Design View   |   Big Formula Bar   |  Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells   |  Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ... Top 15 Toolsets:  12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

#### Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

• Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
• Open and create multiple documents in new tabs of the same window, rather than in new windows.
• Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!