Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if a cell contains values from a list

Tags:

excel

I am trying to check if a cell contains (not equals) a value from a list. I would prefer if the formula returned a true/false result so I can further embed it into an if function.

Sample of values in cells I want to check. For clarity, please call these column A in suggestions.

MIA/EWR/MIA
LGA/PIT
HKG/TPE/HKG/MNL/HKG
LGB/IAD
MIA/GRU/MIA
YUL/LGA
FLL/BOG/MDE/FLL SFO/LAX/SFO

A sample of what I would like to check for is below. I have 165 values I need to check if that makes a difference in your suggestion. Please reference column B for this list. BOG
BOM
GRU
JAL
MDE
MNL
THR
TUN

Thank you in advance!

like image 679
user3155194 Avatar asked Jan 02 '14 21:01

user3155194


People also ask

How do you check if a cell matches a list?

Check if a cell value match to a list with formula. You can use the following formula to check if a certain cell value match to a list or not in Excel. 1. Select a blank cell, enter formula =IF(ISNUMBER(MATCH(C2,A2:A7,0)),1,0) into the Formula Bar, and then press the Enter key.


1 Answers

Based on your description, the data setup looks like this:

enter image description here

In cell C2 and copied down is this formula:

=SUMPRODUCT(COUNTIF(A2,"*"&$B$2:$B$11&"*"))>0
like image 195
tigeravatar Avatar answered Oct 20 '22 01:10

tigeravatar