INDEX,MATCH Multiple exact words from cells with variances.

steveperry

New Member
Joined
Feb 27, 2018
Messages
1
Hi,

I'm trying to create an index/match type formula that will match multiple exact words in cells that contain those words as well as variances such as double spacing, extra letters, extra words, and variable orders of the words. I've been scouring for answers without any real success. Any help would be greatly appreciated!

Example:
C D E F
ParentAthleteMatchReturn
Bobby BoucheBilly BoucheBobby BoucheBilly Bouche
Timmys DadTimmyTimmys Dad#N/A
Johnny WafflesEggo WafflesJohnny and Susie Waffles#N/A
Ernie ErnsSally ErnsErnie Q. Erns#N/A
Jose RuizPedro MartinezJose RuizPedro Martinez

<colgroup><col span="2"><col span="2"><col span="2"><col></colgroup><tbody>
</tbody>
This is the formula I'm using in the return column F.

=INDEX($D$2:$D$6,MATCH(E3,$C$2:$C$6,0))

How can I match the parents despite the variances to return the athlete. I can use the "Trim" function to erase the double spaces, but I wouldn't mind having something that is all-encompassing.

Thanks for your help, it is much appreciated!

-Steve
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Perhaps This...

Code:
Sub ExactWords()
    Dim c As range, Rng As range, x As range
    Dim i As Long, LR As Long
    Dim Arr As Variant
    Dim ConvertNonBreakingSpace As String, s As String
    Application.ScreenUpdating = False
    On Error Resume Next
    Set Rng = ActiveSheet.UsedRange
    Arr = Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 127, 129, 141, 143, 144, 157)
    For Each x In Rng
        s = x
            If ConvertNonBreakingSpace Then s = replace(s, Chr(160), " ")
                For i = LBound(Arr) To UBound(Arr)
                    s = replace(s, Chr(Arr(i)), "")
                Next
            x = Application.WorksheetFunction.Trim(s)
        Next
    LR = range("C" & Rows.Count).End(xlUp).Row
    For Each c In range("C2:C" & LR)
        If c.Value Like c.Offset(, 2).Value Then
            c.Offset(0, 3).Value = c.Offset(0, 1).Value
        Else
            c.Offset(, 3).Value = "#N/A"
        End If
    Next c
    Application.ScreenUpdating = True
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,217,412
Messages
6,136,470
Members
450,015
Latest member
excel_beta_345User

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