Help Seaching array

Birtles

New Member
Joined
Jan 8, 2014
Messages
4
Hi Guys,

Please could you help me, i have 2 lists and want to search list 2 to see if there are any partial matches to list 1.

eg.

List 1
ball
light
hoop

List 2
cloud
apple
soccerball
road
trafficlight

ive tried {=SEARCH($A$1:$A$3,B1:B5,1)} as the logic seems correct but i am obviously not on the right track and get 3 #VALUE! and 2 #N/A results

Could you please assist.

Many Thanks!
Clinton
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
You can use vlookup instead of search

=IFERROR(VLOOKUP(A2,$B:$B,1,0),"")

paste in col C2 and drag it till the list1
 
Upvote 0
Hi Guys,

Please could you help me, i have 2 lists and want to search list 2 to see if there are any partial matches to list 1.

eg.

List 1
ball
light
hoop

List 2
cloud
apple
soccerball
road
trafficlight

ive tried {=SEARCH($A$1:$A$3,B1:B5,1)} as the logic seems correct but i am obviously not on the right track and get 3 #VALUE! and 2 #N/A results

Could you please assist.

Many Thanks!
Clinton

Do you want a result per record in B or a global diagnostic result i.e., a single value og 1 or 0?
 
Upvote 0
It would be great if you could clarify by answering Aladin's question, but until then, there are 2 ways to go by this on a single line query that i can think of


1) Number of occurances

Excel Workbook
AB
1List 1Number of occurances in list 2
2ball1
3light1
4hoop0
5
6List 2
7cloud
8apple
9soccerball
10road
11trafficlight
12
Sheet2




2) Return the string which matches (Just the 1st one for now)

Excel Workbook
AB
1List 1String match
2ballsoccerball
3lighttrafficlight
4hoop 
5
6List 2
7cloud
8apple
9soccerball
10road
11trafficlight
Sheet1
 
Upvote 0
Sheet2

AB
1List 1Number of occurances in list 2
2ball1
3light1
4hoop0
5
6List 2
7cloud
8apple
9soccerball
10road
11trafficlight
12

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:64px;"><col style="width:196px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
B2=IFERROR(COUNTIF( A7:A11,"*"&A2&"*"),"")
B3=IFERROR(COUNTIF( A8:A12,"*"&A3&"*"),"")
B4=IFERROR(COUNTIF( A9:A13,"*"&A4&"*"),"")

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4



2) Return the string which matches (Just the 1st one for now)

Sheet1

AB
1List 1String match
2ballsoccerball
3lighttrafficlight
4hoop
5
6List 2
7cloud
8apple
9soccerball
10road
11trafficlight

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:64px;"><col style="width:72px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
B2=IFERROR(VLOOKUP("*"&A2&"*", A7:A11,1,0),"")
B3=IFERROR(VLOOKUP("*"&A3&"*", A8:A12,1,0),"")
B4=IFERROR(VLOOKUP("*"&A4&"*", A9:A13,1,0),"")

<tbody>
</tbody>

<tbody>
</tbody>

Hi dispelthemyth

This is almost what i am wanting, but instead of returning Soccerball next to ball from list one, i need ball to be returned next to soccerball in list 2.

Apologies all for not clearly outlining my problem
 
Upvote 0
Hi Birtles,

Try this .. Array formula

={IF(SUM(IFERROR(MATCH(A2:A5,$B$2:$B$6,0),0))>1,"Yes","No")}



enter the formula with cntrl + shift + enter
 
Upvote 0
Hi Aladin,

a Yes or no, or even a 1 or 0

1. Control+shift+enter, not just enter:
Rich (BB code):
=(SUM(MMULT(ISNUMBER(SEARCH(TRANSPOSE(IF(A1:A3="","##",A1:A3)),B1:B5))+0,
  ROW(A1:A3)^0))>0)+0
yields a diagnostic value: 1 meaning "Yes, there is at least one partial match", 0 the opposite.

2. Control+shift+enter:
Rich (BB code):
=SUM(IF(MMULT(ISNUMBER(SEARCH(TRANSPOSE(IF(A1:A3="","##",A1:A3)),B1:B5))+0,
  ROW(A1:A3)^0)>0,1))
yields a count of partially matching items.
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,718
Members
448,986
Latest member
andreguerra

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