I have a table in a Google Document. How can I convert rows into columns, i.e. transpose the table?
Example:
Best Answer
I would use the transpose command of Sheets for this.
Copy-paste the table into spreadsheet, e.g., into the range A1:E7
Elsewhere on that sheet, enter =transpose(A1:E7)
Copy-paste the output back into the document, which will recognize it as a table.
I tested this with a table similar to yours, containing linebreaks in some cells. The only thing lost in the process was the text alignment: the output of transpose command always has the default alignment (right-aligned numbers, left-aligned text). But this is not hard to fix manually.
Insert a new table row at the new location for the existing row. To do so, place the mouse pointer on the row where you want to place the new one, then press the left mouse button to open the context menu and choose either "Insert row above" or "Insert row below".
Right-click and drag to select all the contents on the old row, then cut the selected contents (CTRL+X); the old row will remain there but it will be empty.
Right-click on the first cell of the new row to select it, then paste the contents cut before (CTRL+V).
Delete the old row. To do so, place the mouse pointer on the old row, then press the left mouse button to open the context menu and choose "Delete row".
This is obviously not a great solution, but it might be better than recreating the entire table from scratch?
I just tried it in Chrome on Windows and it works the following way. Start selecting the table just below the lower-left cell (click where the cursor changes to the one indicating text entry) and drag the selection all the way up to the top-left cell until all of them are filled with a blueish highlight. Then press CTRL + C, switch to Google Spreadsheet and press CTRL + V.
In the screenshot the highlight is gray because the window was out of focus.
Best Answer
I would use the
transpose
command of Sheets for this.=transpose(A1:E7)
I tested this with a table similar to yours, containing linebreaks in some cells. The only thing lost in the process was the text alignment: the output of
transpose
command always has the default alignment (right-aligned numbers, left-aligned text). But this is not hard to fix manually.