lookup to see if any of the values (from a list) exist in a cell.

artins

New Member
Joined
Aug 8, 2011
Messages
5
How do I lookup to see if any of the values in a list exist in a cell?

Currently I use this formula but I am sure there is an easier way to do it

The list on a worksheet named "List".

=IF(OR(ISNUMBER(SEARCH(List!$A$1,A2)),ISNUMBER(SEARCH(List!$A$2,A2)),ISNUMBER(SEARCH(List!$A$3,A2)),ISNUMBER(SEARCH(List!$A$4,A2)),ISNUMBER(SEARCH(List!$A$5,A2)),ISNUMBER(SEARCH(List!$A$6,A2))),1,"")

I need to check the cell in column A of a worksheet to see if it contains any of the values in a list on worksheet "List", if so return "1".

Your help is greatly appreciated.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hi friend:)

Try this simple illustration.
Hope this add help:)
Excel Workbook
ABCD
1LookupValueReturnValueLookupTable
2a1a
3b1b
4c1c
5111
6212
730
Sheet7
Excel 2010
Cell Formulas
RangeFormula
B2=IF(ISNA(MATCH(A2,$D$2:$D$6,0)>0),0,1)
B3=IF(ISNA(MATCH(A3,$D$2:$D$6,0)>0),0,1)
B4=IF(ISNA(MATCH(A4,$D$2:$D$6,0)>0),0,1)
B5=IF(ISNA(MATCH(A5,$D$2:$D$6,0)>0),0,1)
B6=IF(ISNA(MATCH(A6,$D$2:$D$6,0)>0),0,1)
B7=IF(ISNA(MATCH(A7,$D$2:$D$6,0)>0),0,1)


Hope for feedback:)
 
Last edited:
Upvote 0
not too sure what you want returned if you find the item in your list, but adapt this construct. Tested and works, needs entered with Ctrl + Shift + Enter, just seen the end of your formula, replace True with 1 and false with ""
 
Upvote 0
This
=IF(OR(ISNUMBER(SEARCH(List!$A$1,A2)),ISNUMBER(SEARCH(List!$A$2,A2)),ISNUMBER(SEARCH(List!$A$3,A2)),ISNUMBER(SEARCH(List !$A$4,A2)),ISNUMBER(SEARCH(List!$A$5,A2)),ISNUMBER(SEARCH(List!$A$6,A2))),1,"")

should shorten quite easily to this

=IF(OR(List!$A$1:$A$6=A2),1,"")

Not tried this on any data but it should work just the same

Ctrl + Shift + Enter not just enter
 
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,911
Members
452,949
Latest member
beartooth91

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top