Can Rows Be Combined in Excel?

Kevin Neufeld

Board Regular
Joined
Oct 6, 2014
Messages
50
Hello - looking for some help. The below current report shows (2) transport orders that are representing (1) load. The data is shown in 2 lines as the delivery city for each is different. What I am looking for is a method to take that data and make one line. I have shown an example of the desired output which would put the 2nd delivery city out to the right and have all data in one row.

Thanks in advance


Current Report
DateTransport ID #Load ID #Origin CityDelivery City
1/6/20a11Granite CityTaylorville
1/6/20a21Granite CityAssumption
Desired Output
DateLoad ID #Origin City Delivery City 1Delivery City 2
1/6/201Granite CityTaylorvilleAssumption
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
with Power Query

DateTransport ID #Load ID #Origin CityDelivery CityDateLoad ID #Origin CityDelivery City.1Delivery City.2
01/06/2020a11Granite CityTaylorville01/06/20201Granite CityTaylorvilleAssumption
01/06/2020a21Granite CityAssumption

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Type = Table.TransformColumnTypes(Source,{{"Date", type date}}),
    Group = Table.Group(Type, {"Date", "Load ID #", "Origin City"}, {{"Count", each _, type table}}),
    List = Table.AddColumn(Group, "Delivery City", each [Count][Delivery City]),
    Extract = Table.TransformColumns(List, {"Delivery City", each Text.Combine(List.Transform(_, Text.From), ","), type text}),
    Split = Table.SplitColumn(Extract, "Delivery City", Splitter.SplitTextByAnyDelimiter({","}))
in
    Split
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,580
Members
449,039
Latest member
Arbind kumar

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