How to Move Completed or Shipped Rows to the Top in Excel
Question details
The user needs to organize an inventory worksheet by moving rows with completed shipment information to the top.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Organizing and tracking an inventory or order worksheet based on shipment status.
- Observed behavior
- The user wants to group all completed or shipped orders at the top of the dataset for better visibility and management.
Ensure your inventory dataset is formatted as an Excel Table (Ctrl+T) so that formulas in helper columns automatically apply to newly added order rows.
Use a Helper Column with XLOOKUP and Custom Sort
Extract the shipment date or status into a single auxiliary column using XLOOKUP, then sort the table by this new column.
This method consolidates shipment completion data from multiple columns into a single auxiliary column, making it simple to sort the entire table without losing row integrity.
Insert a new column at the end of your inventory dataset (e.g., Column F) and name it 'Shipment Date' or 'Status'.
Select the first empty cell in the helper column and enter an XLOOKUP formula to extract the shipment date from your data columns (e.g., columns C:E). Press Enter to apply.
Click the drop-down filter arrow on your new helper column's header. Choose 'Sort Newest to Oldest' or 'Sort A to Z' depending on your data type to bring the completed rows to the top.

Sort and Filter Inventory Worksheets with WPS Spreadsheet
WPS Spreadsheet offers powerful sorting, filtering, and lookup functions like XLOOKUP, making it incredibly simple to organize large inventory and order tracking sheets.
- 1. Open your Spreadsheet: Launch WPS Office and open your inventory Excel file.
- 2. Add a Helper Column: Create a new column and use the built-in XLOOKUP function to pull the shipment dates into one unified column.
- 3. Apply Custom Sort: Navigate to the Data tab, click Sort, and select your helper column to arrange all shipped items neatly at the top of your sheet.

Frequently Asked Questions
Can I automatically move shipped rows to another sheet instead of sorting them?
Yes. You can use the FILTER function on a new worksheet to automatically pull in rows from your main inventory sheet where the shipment status is marked as 'Completed' or 'Shipped'.
Why did my rows misalign after applying the sort?
This usually happens if you only select the helper column before sorting. To prevent this, format your data as a Table (Ctrl+T) or ensure all columns in the dataset are selected before clicking the Sort button.
Does the XLOOKUP function work in older versions of Excel?
XLOOKUP is only available in Microsoft 365 and Excel 2021 or newer. If you are using an older version, you can achieve the same result using a combination of INDEX and MATCH functions.




