Have a sheet with approx. 900+ rows. I need a formula that will automatically transpose items horizontally if the address is the same. (see pic)

bgiovanni1

New Member
Joined
Dec 11, 2019
Messages
12
Office Version
  1. 365
Platform
  1. Windows
I am trying to save lots of time and headache, so any help is appreciated! There are many addresses that have multiple tenants. I need the tenants horizontally transposed into the same row so that I can use this as a mail merge. I guess part two of this is that it would be great to also have a way to quickly and easily delete the other duplicates after this is done without having to do it manually, but that is not as important. Thank you in advance for your help!

Brenda :)
Excel hel no 2.png
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
like this?
(part of the table)
JoshJasonNickMohammedAmyKareemLaurenMaryAtexLeah
1274 Washington St1274 Washington SI1274 Washington SI1274 Washmaton Si1275 E 24th1275 E 24th1275 E 24th1275 Ferry St1275 Ferry St1275 Ferry Studio

or show representative source and expected result
 
Upvote 0
So basically, these people live at the same address and are roommates. If I wanted to send a letter to them, it would be one letter to all of them.
 
Upvote 0
So like this? :)

AddressTenant.1Tenant.2Tenant.3Tenant.4
1274 Washington StJoshJasonNickMohammed
1275 E 24thAmyKareemLauren
1275 Ferry StMaryAtex
1275 Ferry StudioLeah
1293 Tyler 28LucasLoganCh*oeRyan
1336 HighAlevAlexandriaRaphaelJimJones
168 N Cleveland StMome
1685 High StJag


with Power Query M-code:
Code:
// Table1
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Group = Table.Group(Source, {"Address"}, {{"Count", each _, type table}}),
    Tenant = Table.AddColumn(Group, "Tenant", each List.Distinct(Table.Column([Count],"Tenant"))),
    Extract = Table.TransformColumns(Tenant, {"Tenant", each Text.Combine(List.Transform(_, Text.From), "="), type text}),
    Split = Table.SplitColumn(Extract, "Tenant", Splitter.SplitTextByAnyDelimiter({"="}))
in
    Split
 
Upvote 0
Totally You are awesome, thank you! I am going to try it now and will report back. :)
 
Upvote 0
So, now I have a whole other problem-- Power query won't start up at all. I will work on that and hope I can use your code!
 
Upvote 0
Power Query is built-in to 365
maybe find : Data - New Query - From Other Sources - Blank Query , then paste code there (I don't know how 365 is organised, sorry :) )
be aware the table name should be the same, source table name = table name in the code
 
Upvote 0
no, that's exactly what I did. It comes up and freezes. Can't do anything. I will try to troubleshoot.
 
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,223
Members
452,620
Latest member
dsubash

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