Change Row Order Without Mixing Up Your Table’s Data
Sort or move whole rows in Google Sheets, use a sequence column for custom order, and check the exported table before publishing.

To change the order of rows in a table, sort the whole table by a column, move complete rows manually, or add a numeric sequence column for a custom order. Never sort just one column when its values belong to records spread across several columns.
For a table you plan to publish, a sequence column is the most useful way to make an intentional order explicit. The Google Sheets workflow below covers all three methods.
Set a custom order with a sequence column
Suppose you want workflow stages to appear as Draft → Review → Published, rather than alphabetically. This fictional sample starts in the wrong order:
| display_order | stage | document_count |
|---|---|---|
| 3 | Published | 12 |
| 1 | Draft | 8 |
| 2 | Review | 5 |
Add display_order and assign each row a number for its intended position. Sorting the entire table by that column, smallest to largest, gives:
| display_order | stage | document_count |
|---|---|---|
| 1 | Draft | 8 |
| 2 | Review | 5 |
| 3 | Published | 12 |
The counts stay attached to their stages. Keep display_order in the published dataset if readers or downstream users need to reconstruct this sequence. Explain it as “workflow sequence,” not “rank”: the order does not indicate which stage has the largest count.
If you also need to recover the starting order, save a separate original_order column containing fixed values—1, 2, 3, and so on—before sorting. Give new rows an explicit sequence value as you add them.
Sort rows in Google Sheets
For alphabetical, numerical, date-based, or sequence-column ordering, use a range sort on a computer:
- Select the complete table, including its header row and every column belonging to each record. In the example, select
A1:C4. - If the sheet includes a header row, freeze the first row.
- Choose Data → Sort range → Advanced range sorting options.
- Check Data has header row.
- Select the column to sort by and choose the direction. For
display_order, use ascending order, A to Z. - Click Sort.
Google also supports Add another sort column for a secondary rule. For example, sort by stage sequence first, then by a unique record ID to give rows within each stage a defined order. These steps follow Google’s range-sorting documentation.
If only one column changed position, undo immediately. Re-select the full table before trying again. Sorting stage names without their counts would create incorrect records, not merely a different presentation. For a name-based example, see how to alphabetize without mixing rows.
Move a few rows manually
For a small table, moving complete rows can be quicker than defining a sorting rule:
- Select the row or rows you want to move using their row numbers.
- Open Edit and choose the direction, such as Move row up.
- Repeat until the rows are in the intended positions.
Google Sheets also lets you drag rows to a new location, as described in its row-moving instructions.
Use this method on a sheet dedicated to the table: moving a whole sheet row also moves any unrelated content alongside it. If the order matters beyond this editing session, record it in display_order rather than relying only on where rows sit.
Check the order before publishing
Before sharing the file:
- Confirm that headers remain at the top and the number of data rows is unchanged.
- Compare several complete records with the original, checking IDs, labels, and values together.
- Check that sequence values are numeric, populated, and unambiguous.
- Reopen the exported file and inspect its row order and column alignment.
- Publish only data cleared for public release—never sensitive information.
TablePage accepts CSV, TSV, XLSX, and XLS files and turns an upload into a public dataset page. Check the resulting page rather than assuming it will display the same initial order as your spreadsheet.
Include a short explanation beside the table, such as: “Stages follow workflow sequence; sort display_order ascending to restore that order.” This makes the intended arrangement understandable even when readers explore the data differently.