Finding Partial String while using List as a Reference

Avid1530

New Member
Joined
Mar 29, 2018
Messages
4
Hello Wizards of Excel,

I'm in a bit of a bind I'm trying to find a partial match within a list of keywords. I'm looking for the return result to be the word found in the list. I tried vloookup and index match, but the problem is that it only finds the exact match of the word and doesn't take into account any symbols or characters that maybe in front or in between the particular keyword I'm searching for. I even tried adding an "*" as a wildcard with the vlookup and index-match formuals, but it still didn't get the information I'm looking for. I provide a sample below of what I'm looking for. Any help shedding light on this would be appreciated.

-- corrupted image removed --
 
Last edited by a moderator:

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Here is some code you might look at:

Private Sub TextBox1_Change()
Dim rng, cCell
Me.ListBox1.Clear
With Sheets("FileNames")
For Each cCell In .Range("A1:A" & .Cells(Rows.Count, 1).End(xlUp).Row)
If cCell.Text Like "*" & Me.TextBox1 & "*" Then
Me.ListBox1.AddItem cCell.Text​
End If
Next
End With
End Sub
 
Upvote 0
Hello Wizards of Excel,

I'm in a bit of a bind I'm trying to find a partial match within a list of keywords. I'm looking for the return result to be the word found in the list. I tried vloookup and index match, but the problem is that it only finds the exact match of the word and doesn't take into account any symbols or characters that maybe in front or in between the particular keyword I'm searching for. I even tried adding an "*" as a wildcard with the vlookup and index-match formuals, but it still didn't get the information I'm looking for. I provide a sample below of what I'm looking for. Any help shedding light on this would be appreciated.
Cant see the sample though
 
Last edited by a moderator:
Upvote 0
Sorry about that I took a screenshot and it didn't load, Here is it below:

List
Return ValuesReference
Cool blue shirts
blue
get yellow shirts today for $10.99yellow
Pink shirt salepink
"yellow pants for sale"
+blue +shirt +discount +sale
[pink pants discount]
shirts that are blue on sale
"blue shade of pants"
green jeans
get your pink shirt today!
 
Last edited by a moderator:
Upvote 0
Sorry about that.....Here is the table.
If the items in the List column match anything in the Reference column I would like it to return those values

ListReturn ValuesReference
Cool blue shirtsblueblue
get yellow shirts today for $10.99yellowyellow
Pink shirt salepinkpink
"yellow pants for sale"yellow
+blue +shirt +discount +saleblue
[pink pants discount]pink
shirts that are blue on saleblue
"blue shade of pants"blue
green jeansN/A
get your pink shirt today!pink

<tbody>
</tbody>
 
Upvote 0
Like this

Book1
ABCD
1ListReturn ValuesReference
2Cool blue shirtsblueblue
3get yellow shirts today for $10.99yellowyellow
4Pink shirt salepinkpink
5"yellow pants for sale"yellow
6+blue +shirt +discount +saleblue
7[pink pants discount]pink
8shirts that are blue on saleblue
9"blue shade of pants"blue
10green jeansN/A
11get your pink shirt today!pink
Sheet2
Cell Formulas
RangeFormula
B2:B11B2=IFERROR(INDEX($D$2:$D$4,MATCH(TRUE,IFERROR(SEARCH($D$2:$D$4,$A2),0)>0,0)),"N/A")
 
Last edited by a moderator:
Upvote 0
Or try this:

=LOOKUP(1,-SEARCH(D$2:D$4,A2),$D$2:$D$4)

If the reference list contains complex colours, for example dark-green and green, put the reference list in the descending order of colour names before use.
 
Upvote 0

Forum statistics

Threads
1,214,614
Messages
6,120,525
Members
448,969
Latest member
mirek8991

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