Transpose and Append Multiple Tables in a Workbook Dynamically

takoyaki

New Member
Joined
Oct 24, 2022
Messages
30
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I have multiple tables in the same workbook that are formatted with the column headers in one column and the corresponding data to the right (formatted this way for easier visibility of the user). See Tables 1 and 2 for examples. They all have the same naming convention beginning with the same prefix followed by an underscore and the table's number (for instance, Table_1, Table_2).

Does anyone know of a way to transpose the column header column (Column 1 in this example) and append all tables in the workbook that follow the specified naming convention to produce the Desired Output below? The goal is to create a Snapshot table that can review all of the individual tables' data at a glance.

1684769451032.png
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hi all,

I have multiple tables in the same workbook that are formatted with the column headers in one column and the corresponding data to the right (formatted this way for easier visibility of the user). See Tables 1 and 2 for examples. They all have the same naming convention beginning with the same prefix followed by an underscore and the table's number (for instance, Table_1, Table_2).

Does anyone know of a way to transpose the column header column (Column 1 in this example) and append all tables in the workbook that follow the specified naming convention to produce the Desired Output below? The goal is to create a Snapshot table that can review all of the individual tables' data at a glance.

View attachment 92062
For clarification, I am using Power Query in Excel.
 
Upvote 0
For clarification, I am using Power Query in Excel.
Here is how I solved the problem; if anyone has any other solutions please feel free to share!

Power Query:
let
    Source = Excel.CurrentWorkbook(),
    FilteredRO = Table.SelectRows(Source, each Text.StartsWith([Name], "Table_")),
    ExpandedContent = Table.ExpandTableColumn(FilteredRO, "Content", {"Column1", "Column2"}, {"Column1", "Column2"}),
    PivotedColumn = Table.Pivot(Table.TransformColumnTypes(ExpandedContent, {{"Column1", type text}}, "en-US"), List.Distinct(Table.TransformColumnTypes(ExpandedContent, {{"Column1", type text}}, "en-US")[Column1]), "Column1", "Column2"),
in
    PivotedColumn
 
Upvote 0
Solution

Forum statistics

Threads
1,215,335
Messages
6,124,326
Members
449,155
Latest member
ravioli44

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