excel partial match in any of the lookup data

chaitanya1124

New Member
Joined
Jul 24, 2017
Messages
5
I have data in column A and B have lookup data. If the any of the lookup data is partially matching in the result column need to put lookup data.


I tried with VLOOKUP but no luck. Please help me.


Columns:


A B(Lookup) C(Result)
FY|F|V|D|Safety|3M Toro 3M
FY|F|V|D|POP|ToroDays 3M Toro
FY|F|V|D|Lumber|GroundContact honeywell NA(Not available)
FY|F|V|D|airfilters|honeywell samsung honeywell
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Welcome to the forums

Try the below vlookup formula

=VLOOKUP("*"&B2&"*",A:A,1,0)
 
Upvote 0
No. Its not working. It is giving NA. Table was not populated properly, so I pasted here again.

<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; white-space: inherit;">A B(Lookup) C(Result)
FY|F|V|D|Safety|3M Toro 3M
FY|F|V|D|POP|ToroDays 3M Toro
FY|F|V|D|Lumber|GroundContact honeywell NA(Not available)
FY|F|V|D|airfilters|honeywell samsung honeywell</code>
 
Upvote 0
Code:
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; white-space: inherit;">A                                  B(Lookup)            C(Result)
FY|F|V|D|Safety|3M                 Toro                 3M
FY|F|V|D|POP|ToroDays              3M                   Toro
FY|F|V|D|Lumber|GroundContact      honeywell            NA(Not available)
FY|F|V|D|airfilters|honeywell      samsung              honeywell</code>
 
Upvote 0
I am a bit confused here ... Toro is the lookup value that you've searched for in cell A2 which doesn't exist yet you have 3M in the result (column C). However, Honeywell is showing NA in column C & Samsung is not showing NA yet it doesn't exist at all in column A
 
Upvote 0
Requirement is: for A2 (FY|F|V|D|Safety|3M). take the B column first value and search whether there is any match if not take second value in B column and repeat the process for all the B column values and if there is match print the B column value in Result. Does that make sense?
 
Upvote 0
Requirement is: for A2 (FY|F|V|D|Safety|3M). take the B column first value and search whether there is any match if not take second value in B column and repeat the process for all the B column values and if there is match print the B column value in Result. Does that make sense?

Try the below code & let me know if this is what you're looking for

Code:
Sub NotSureWhy()

Dim LastRow As Long, text1 As String, text2 As String, x As Long, y As Long
LastRow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row

For x = 2 To LastRow
    text1 = Cells(x, 1).Value
    
    For y = 2 To LastRow
        text2 = Cells(y, 2)
            If "*" & text1 & "*" Like "*" & text2 & "*" Then
                Cells(x, 3).Value = text2
                Exit For
            Else
                Cells(x, 3).Value = "N/A"
            End If
    Next y
Next x

End Sub
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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