Expand a comma separated table in multiple rows

2020-04-21 03:08发布

问题:

I have some table with a key and multiple values associated to it in a comma separated way. Would like to change it to one row per value, repeating the key multiple times as follow.

Would you know how to do this without any Excel macro?

回答1:

Assuming your numbers are text format and abc is in A2, select ColumnB, DATA > Data Tools - Text to Columns, Delimited, Comma, Column data format Text (for all columns) then label the columns and create a Table via a PivotTable from your data with Multiple consolidation ranges as described here. Delete ColumnB and Filter the Value column to remove blank rows.