Duplicate Rows (almost!)

IanBr

New Member
Joined
Sep 17, 2018
Messages
15
Office Version
  1. 365
Hi, hoping someone can help...

I have an excel table of about 16,000 rows

Many of these are duplicates but the info is split between different rows - so for example, for a particular entry there might be an address in column B against the first entry but a phone number in column C against the duplicate.

I want to end up with one table of info containing all available data with no duplicates...is this possible?
 

Attachments

  • Example.JPG
    Example.JPG
    19.3 KB · Views: 11

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
How about this

VBA Code:
Sub jec()
 Dim ar, a As Variant, i As Long
 ar = Cells(1, 1).CurrentRegion
 
 With CreateObject("scripting.dictionary")
   For i = 1 To UBound(ar)
      If Not .exists(ar(i, 1)) Then
        .Item(ar(i, 1)) = Array(ar(i, 1), ar(i, 2), ar(i, 3))
      Else
        a = .Item(ar(i, 1))
        If a(1) = "" Then a(1) = ar(i, 2)
        If a(2) = "" Then a(2) = ar(i, 3)
        .Item(ar(i, 1)) = a
      End If
   Next
   Cells(1, 6).Resize(.Count, 3) = Application.Index(.items, 0, 0)
 End With
End Sub
 
Upvote 0
With power query very easy

Power Query:
let
    source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    ar = Table.Distinct(Table.FillUp(source,{"Address", "Phone"}), {"Account"})
in
    ar
 
Upvote 0

Forum statistics

Threads
1,215,403
Messages
6,124,710
Members
449,182
Latest member
mrlanc20

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