Document Editing Problems

Sort Excel Rows, Edit Data, and Restore the Original Order

John WilsonJohn Wilson Nov 14, 2026 868 views

Question details

The user wants to sort Excel rows, edit the data, and then return the rows to their original order.

How to Sort Excel Rows and Restore the Original Order
Product
Microsoft Excel
Device & OS
not provided
Scenario
A roster needs to be sorted by a date or category for editing, then returned to its initial sequence.
Observed behavior
Excel does not automatically retain a reusable record of the original row order after sorting.
Before you start

Add an empty column beside the roster before sorting. Make sure each row has a unique sequence number and that the entire roster is included in each sort.

Solution 1Recommended

Add an Original Order column and sort by it later

Use a permanent sequence number to restore the roster after sorting and editing.

1
Create a sort key

Add a column named Original Order beside the roster. Enter 1 and 2 in the first two data rows, select both cells, and drag the fill handle down to number every row.

2
Sort the complete roster

Select the entire roster, including Original Order, then open Data > Sort. Choose the date or category column and the desired sort order. If Excel asks, choose Expand the selection.

3
Make your edits

Edit the required cells in the sorted roster. Leave each row's Original Order number unchanged so it remains attached to that row.

4
Restore the initial sequence

Select the entire roster again, open Data > Sort, and sort the Original Order column from smallest to largest.

Add an Original Order column and sort by it later
Keep the sort key: You can hide the Original Order column if you do not want it displayed. If you add rows later, assign each one a unique number representing its intended position.
Work with spreadsheets in WPS

Restore Sorted Rows in WPS Spreadsheets

Use an Original Order column in WPS Spreadsheets to sort a roster, edit its data, and return the rows to their starting sequence.

  1. 1. Open the workbook: Open WPS Spreadsheets and choose Open to select your Excel workbook.
  2. 2. Number the rows: Add an Original Order column, enter 1 and 2 in the first two data rows, and drag the fill handle down to create a unique number for each row.
  3. 3. Sort and edit: Select the full roster, including the new column, then use Data > Sort to sort by the desired date or category. Edit the sorted rows without changing their sequence numbers.
  4. 4. Restore and save: Select the full roster and use Data > Sort to sort Original Order in ascending order. Choose File > Save to save your changes.
Restore row order with a numbered sort key.Open and edit Microsoft Excel XLS and XLSX files.Use familiar spreadsheet sorting and editing tools.Work with spreadsheets for free.
microsoft office alternative - wps office

Frequently Asked Questions

Can Excel automatically restore the original row order after a sort?

Excel does not automatically keep a reusable original-order key. Before sorting, add a column with unique sequential numbers, then use Data > Sort to sort that column from smallest to largest when you want to restore the order.

How do I keep row data together when sorting?

Select the entire roster, including the Original Order column, before choosing Data > Sort. If Excel prompts you, choose Expand the selection so the other columns move with the sorted rows.

Can I hide the Original Order column?

Yes. Right-click the Original Order column header and choose Hide. Unhide it when you need to sort by its numbers again.

What happens if I add rows after creating the sort key?

Give each new row a unique Original Order value that represents where it should appear. Then include the new rows and the key column when you use Data > Sort.