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

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Using Excel Fuzzy Add-in to compare two columns of names

    Author
    Topic
    #498718

    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

    Viewing 1 reply thread
    Author
    Replies
    • #1492758

      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).

    • #1492935

      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.

      39615-Imandel1

      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:

      39616-Imandel2

      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

    Viewing 1 reply thread
    Reply To: Using Excel Fuzzy Add-in to compare two columns of names

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: