Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Chapel Hill, North Carolina, USA
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Using Excel Fuzzy Add-in to compare two columns of names

    I need to compare two columns of names (from different sources) - each associated with the same ID and identify if they are associated with the same person.

    For example:

    Column A Column B Column C
    ID Name 1 Name 2
    12345 Smith, Robert Robert Smith
    2356 Doe, Jane Jane Z Doe

    Will Excel Fuzzy Add-in help with this? I've searched online, but don't see a way to compare two columns of data that already paired up.

    Thanks!

    Larry

  2. #2
    New Lounger
    Join Date
    Dec 2013
    Posts
    22
    Thanks
    2
    Thanked 6 Times in 6 Posts
    Hi Larry,

    I'd never heard of Microsoft's Fuzzy Lookup Add-in, so thanks for your post. I've downloaded it and looked at it's Readme document and example spreadsheet. I think you could use it by creating two tables, one with cols. A and B, and a second by copying cols. A and C to two new columns. Then use the add-in to compare the two tables, per the instructions in the Readme document (which is installed when you run the Setup.exe file).

  3. #3
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    2,639
    Thanks
    115
    Thanked 650 Times in 592 Posts
    Imandel,

    Using your post example, here is some code (Example1.xlsm) that will compare columns B and C then place an "X" in column D if they are the same. The code will adjust for any number or records listed.

    Imandel1.png

    In a standard module:
    Code:
    Public Sub Compare()
    LastRow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
    For I = 2 To LastRow
        s = Split(Cells(I, 2), ", ")
        If s(1) & " " & s(0) = Cells(I, 3) Then
            Cells(I, 4) = "X"
        End If
    Next I
    End Sub
    In the more complicated scenario that THill describes, here is example 2 (Exmple2.xlsm). You need to compare ID numbers and their corresponding names from 2 different tables:

    Imandel2.png

    In a Standard Module:
    Code:
    Public Sub Compare()
    LastRow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
    EndRow = ActiveSheet.Cells(Rows.Count, 7).End(xlUp).Row
    For I = 2 To LastRow
        For J = 2 To EndRow
            If Cells(I, 1) = Cells(J, 7) And Cells(I, 2) = Cells(J, 8) Then
                Cells(I, 4) = "X"
                Cells(J, 10) = "X"
            End If
        Next J
    Next I
    End Sub
    The records with an "X" signify a matching ID and name. The code will adjust to the number of records in each table. This code is customizable to handle scenarios with tables between different sheets or workbooks.

    HTH,
    Maud
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •