De-duplicating/merging rows while keeping any data

garyarubin

New Member
Joined
Oct 3, 2023
Messages
5
Office Version
  1. 365
Platform
  1. MacOS
I need to determine whether any people have downloaded any applications. But the database that spits out whether a person has done so can only generate lists for one application at a time. So, I have one spreadsheet showing that Bob downloaded Messenger, and another showing that Bob downloaded WhatsApp. Ultimately, I had 50 spreadsheets like this and had to combine them into a single spreadsheet. I did this by copying the original in each case into a destination file, creating a new column for each app. So, the name of each person is in Column A, and then, if that person has downloaded an app, that information appears in Column B . . . Column ZZZ. The result is that this new file is ~50,000 rows long, with multiple repeats in Column A. In this example, Bob now has two rows, showing his name twice in Column A (A4 and A5), Messenger in Column C (C4), and WhatsApp in Column DD (DD). Is there a way to say, if the name Bob repeats in Column A, then combine those rows into a single row, while preserving the value from Columns C and DD (or whatever columns are populated)? Thanks!
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Could you provide some dummy data to allow us to work with use the XL2BB addin provided in the link
XL2BB
 
Upvote 0
Thanks very much. I can't add in XL2BB, but here is a screenshot. You see Joe Jones has a number of different channels, all imported from different spreadsheets. Question is whether I can collapse all those rows into a single row showing multiple channels.
 

Attachments

  • dummy.png
    dummy.png
    36.4 KB · Views: 5
Upvote 0
With Power Query
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Device enrolled", "Employee Nr", "Type"}, "Attribute", "Value"),
    #"Pivoted Column" = Table.Pivot(#"Unpivoted Other Columns", List.Distinct(#"Unpivoted Other Columns"[Attribute]), "Attribute", "Value")
in
    #"Pivoted Column"

Book1
ABCDEFGHIJKLM
1Device enrolledEmployee NrTypeChannel1Channel2Channel3Channel4Channel5Channel6Channel7Channel8Channel9Channel10
2Jjones1234EmployeeChannel 10
3Jjones1234EmployeeChannel 9
4Jjones1234Employee
5Jjones1234Employee
6Jjones1234Employee
7Jjones1234EmployeeChannel 6
8Jjones1234Employee
9Jjones1234EmployeeChannel 4
10Jjones1234EmployeeChannel 3
11Jjones1234EmployeeChannel 2
12Jjones1234EmployeeChannel 1
13
14
15Device enrolledEmployee NrTypeChannel10Channel9Channel6Channel4Channel3Channel2Channel1
16Jjones1234EmployeeChannel 10Channel 9Channel 6Channel 4Channel 3Channel 2Channel 1
Sheet1
 
Upvote 0
Solution
This was fantastic, thank you. It took me a bit to debug given how much more complex and error-ridden the real spreadsheet was, but this worked, and I really appreciate it.
 
Upvote 0
Thanks for the feedback and glad to hear it worked for you.
 
Upvote 0

Forum statistics

Threads
1,215,076
Messages
6,122,987
Members
449,093
Latest member
Mr Hughes

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