Sort data in a table

You can sort some or all data in a column—alphabetically or by increasing or decreasing values. When you sort a column, the rows of the table reorganize accordingly.

Text in column headers and footers isn’t sorted, but values in hidden rows and hidden columns are.

Create a sorting rule

You can sort a table by creating sorting rules.

  1. Do either of following:

    • Sort the whole table: Click the table, then in the Sort pane of the Sort & Filter inspector, choose Sort Entire Table from the pop-up menu.

    • Sort some of the rows in a column: Select the rows, then in the Sort pane of the Sort & Filter inspector, choose Sort Selected Rows from the pop-up menu.

  2. Click Add a Column.

  3. Choose a column to sort by, then choose Ascending or Descending from the pop-up menu in the rule.

  4. To add more rules, click Add a Column.

    Sorting rules are applied in the order they appear in the inspector. To reorder the rules, move the pointer over the rule, drag Reorder rule button, then click Sort Now.

Note: You can’t sort rows with merged cells.

Delete a sorting rule

If you don’t need a rule, you can delete it.

  1. Click the table.

  2. In the Sort pane of the Sort & Filter inspector, move the pointer over a rule, then click Trash button.

Quickly sort by ascending or descending values

  1. Do either of the following:

    • Sort the whole table: Click the table, move the pointer over the lettered bar at the top of the column, then click the arrow that appears.

    • Sort a range of cells: Select the cells. The selection must include cells from more than one row and can span more than one column. Control-click any column in the table you to sort by.

  2. Choose a sorting option:

    • Sort Ascending or Sort Rows Ascending by [column]: Sort the rows in alphabetical order (A to Z) or by increasing numerical values based on the data in the selected column.

    • Sort Descending or Sort Rows Descending by [column]: Sort the rows in reverse-alphabetical order (Z to A) or by decreasing numerical values based on the data in the selected column.

In columns containing both text and numbers, ascending order sorts by numbers before text (for example, 1a, 1b, 2a, a1, b1). Ascending order also places Boolean (true/false) cells after cells sorted alphabetically or numerically, and places blank cells at the bottom of the column.