Combining multiple columns with the same header name

Shamilton

New Member
Joined
Aug 19, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Thank you in advance for any help you might be able to give, I'm sure this is a simple issue but I am a novice and haven't been able to figure out how to resolve this.

I need to convert data that is formatted as image description briefs in Word into a useable data table in Excel. I've gotten as far as Power Query off of a .txt file, but I can't figure out how to convert the first column into headers and combining headers with the same name. The last image represents the desired result.
 

Attachments

  • example 1.jpg
    example 1.jpg
    64.2 KB · Views: 106
  • example 2.jpg
    example 2.jpg
    122.1 KB · Views: 106
  • example 3.jpg
    example 3.jpg
    166 KB · Views: 105

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I did not import from a word document, so you will have to change the source but this should give you the steps once you have your data in the two columns on how to transpose your data as you wish.

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Filtered Rows" = Table.SelectRows(Source, each ([Column1] <> null)),
    #"Grouped Rows" = Table.Group(#"Filtered Rows", {"Column1"}, {{"Data", each _, type table [Column1=text, Column2=text]}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each Table.AddIndexColumn([Data],"Index",1,1)),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Column2", "Index"}, {"Custom.Column2", "Custom.Index"}),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded Custom",{"Data"}),
    #"Pivoted Column" = Table.Pivot(#"Removed Columns", List.Distinct(#"Removed Columns"[Column1]), "Column1", "Custom.Column2"),
    #"Removed Columns1" = Table.RemoveColumns(#"Pivoted Column",{"Custom.Index"})
in
    #"Removed Columns1"
 
Upvote 0
Solution

Forum statistics

Threads
1,223,702
Messages
6,173,932
Members
452,539
Latest member
delvey

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