Find Duplicates

kbnetguy

New Member
Joined
Nov 18, 2016
Messages
9
I have Column A "Fist Name" and Column B "Last Name". For example

FIRST NAMELAST NAME
Arpil & PatAbernathy
PatAbernathy
DavidAckary
DavidAckary
KarenSmith
BobBarker
EllenBarker
JackSmith
DavidBrady

<tbody>
</tbody>

I want to highlight or indicate in a 3rd column the records that Are Either an exact match like in rows 3 "David Ackary" and row 4 "David Ackary"

AND I would also like to identify those records that COULD be a match like row 1 "April & Pat Abernathy" and row 2 "Pat Abernathy"
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
If you have the option to add a column, I would suggest concatenate and find duplicates. With regard to your second question, an individual can be assumed to only have one FIRST NAME without any spaces. With that said, I would recommend cleaning the data with Convert to Text using the delimiter "space". Then update the table to appropriately separate April Abernathy and Pat Abernathy.

=CONCATENATE(A2," ",B2)
 
Upvote 0
kbnetguy,

If you're comfortable with a vba approach, you might consider the following...

Code:
Sub FindDuplicates_1062243()
Dim arr() As Variant
Dim LastRow As Long, r As Long, r1 As Long
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
ReDim arr(1 To LastRow, 1 To 3)
arr = Range("A1:C" & LastRow)

For r = 2 To UBound(arr)
    For r1 = r + 1 To UBound(arr)
        If arr(r, 1) & arr(r, 2) = arr(r1, 1) & arr(r1, 2) Then
            arr(r, 3) = "rows " & r & ", " & r1
            arr(r1, 3) = "rows " & r1 & ", " & r
        ElseIf arr(r, 2) = arr(r1, 2) And (InStr(arr(r, 1), arr(r1, 1)) > 0 Or InStr(arr(r1, 1), arr(r, 1)) > 0) Then
            arr(r, 3) = "rows " & r & ", " & r1
            arr(r1, 3) = "rows " & r1 & ", " & r
        End If
    Next r1
Next r

arr(1, 3) = "Duplicate Names"
Range("A1:C" & LastRow).Value = arr
Columns(3).AutoFit
End Sub

Cheers,

tonyyy
 
Upvote 0
Hi tonyyy

How about the above example and we have words in same cell separated with comma but no space?


FIRST NAMELAST NAME
Arpil & PatAbernathy
Pat,JohnAbernathy
David,WillAckary,John
David,JakeAckary,Jake

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,214,960
Messages
6,122,479
Members
449,088
Latest member
Melvetica

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