Sorting and transposing tables
Rows (or columns) in a table can be sorted in ascending or descending order according to the data in up to three columns (or rows). Cell data can be evaluated as numbers or as strings of characters. See the examples below.
| |||||||||||||||||||||||||
Original | |||||||||||||||||||||||||
|
| ||||||||||||||||||||||||
Sorted by column 1 |
Sorted by column 1 | ||||||||||||||||||||||||
|
| ||||||||||||||||||||||||
Sorted by column 2 |
Sorted by column 2 |
A table can also be transposed, swapping rows for columns and vice versa as in the following example:
|
| ||||||||||||||||||
Original |
Transposed |
To sort a table or part of a table
- Place the insertion point in the table to be sorted or select the cells to be sorted.
- On the Layout menu, go to Convert and Calculate, and then click Sort.
- If you want to sort columns, click Sort left to right under Options. To sort rows, leave the option deselected.
- Under Sort by, select the column (or row) according to which the rows (or columns) will be sorted; specify whether to evaluate the cell contents as strings or as numbers; and specify whether to order the rows (or columns) in ascending or descending order.
- (optional) If the column (or row) you selected under Sort by contains some cells that have the same contents, select another column (or row) as the second sort criterion under then by and specify its sort options. You can also specify a third column (or row) to sort by.
- Under Options, select the desired options:
- To sort only selected cells, select Sort selected cells only.
- To rearrange only the contents of cells without affecting the cells’ properties, such as alignment and background color, select Sort contents only.
- To exclude the first or last row in the table or selection from being sorted, select Exclude the first selected row or Exclude the last selected row.
- Click OK.
You cannot sort a table that contains any merged cells.
To transpose a table
- Place the insertion point in the table to be transposed.
- On the Layout menu, go to Convert and Calculate, and then click Transpose Table.