Skip to main content

Check if cell equals any value in list

For example, I have a list of text strings in column A, and now, I want to check if cell value in this column equals any value in another list of column E. If equals, display TRUE, otherwise, a FALSE value is displayed as below screenshot shown.


Check if cell equals any value in list with SUMPRODUCT function

To check if a cell equals any value in another list of data, the SUMPRODUCT function can do you a favor. The generic formula for the SUMPRODUCT function is:

=SUMPRODUCT(--(cell = array))
  • cell: A cell that you want to check;
  • array: A range of cells where you want to compare with the specific cell.

1. Please enter or copy the following formula into a blank cell where you want to put the result:

=SUMPRODUCT(--(A2=$E$2:$E$6))>0

2. And then, drag the fill handle down to the cells that you want to apply this formula, now, if the value in cell A2 equals any value in list of E2:E6, a TRUE is shown, if not equals, a FALSE is displayed, see screenshot:


Explanation of the formula:
  • --(A2=$E$2:$E$6): compare the value in A2 with every cell value in range E2:E6, it will returns an array of TRUE or FALSE values, if the cell A2 equals any value in range E2:E6, a TRUE is returned, otherwise, it will be FALSE. And the double hyphens (--) is used to convert TRUE or FALSE to 1 or 0;
  • SUMPRODUCT(--(A2=$E$2:$E$6))>0: SUMPRODUCT will add up the elements in the array, then use >1 to force the result as TRUE or FALSE.

Note: Sometime, you may need to use some specific texts to replace the TRUE or FALSE in the result, in this case, please apply any of the following formulas as you need:

=IF(COUNTIF($E$2:$E$6,A2),"Yes","No")
=IF(OR(INDEX(A2=$E$2:$E$6,)),"Yes","No")


Relative function used:

  • SUMPRODUCT:
  • The SUMPRODUCT function can be used to multiply two or more columns or arrays together, and then get the sum of products.

More articles:

  • 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.How to solve this job in Excel?
  • 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.
  • Show specific text based on value in Excel
  • Supposing, you have a list of values, now, you would like to show a specific text based on the value. For example, if cell value is greater than 1000, then “Increase” text is displayed in another column as below screenshot shown. To deal with this task, both the REPT and IF functions can do you a favor.

The Best Office Productivity Tools

Kutools for Excel - Helps You To Stand Out From Crowd

🤖 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 VLookup: Multiple Criteria  |  Multiple Value  |  Across Multi-Sheets  |  Fuzzy Lookup...
Adv. Drop-down List: Easy 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 Columns to Select Same & Different Cells ...
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 Toolsets12 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 Excel Cells ...)  |  ... and more

Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...

Description


Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

  • One second to switch between dozens of open documents!
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations