Create a Custom Sort Order for Product SKUs in Excel
Question details
Sort parent and child product SKUs by range, color, and a specified size sequence rather than by text embedded in the SKU.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A product list contains parent and component rows that need to be grouped and sorted using product attributes.
- Observed behavior
- The desired order groups related rows by parent SKU, range, and color, then orders sizes as SIN, SMDBL, DBL, and KNG.
Check which parent SKU, range, color, and size belong to each component row. Make sure your data has column headers and identify any size codes that are not in your intended sequence.
Sort SKUs with Helper Columns and a Numeric Size Order
Use this method to keep related product rows grouped and apply a size sequence that does not depend on the SKU text.
Insert columns labeled Parent SKU, Range, Color, and Size. Enter the appropriate values on every row, including each child or component row.
Add a SizeOrder column and enter 1 for SIN, 2 for SMDBL, 3 for DBL, and 4 for KNG. Assign a rank to any other size codes before sorting.
Select all columns and rows in the product list, including the headers, so each SKU stays with its attributes.
Open Data > Sort and check My data has headers. Add ascending sort levels for Parent SKU, Range, Color, and SizeOrder, in that order, then select OK.

Apply a Custom SKU Size Order in WPS Spreadsheet
Use helper columns and a multi-level sort in WPS Spreadsheet to group product rows and apply your own size sequence.
- 1. Open the product list: Open your Excel workbook in WPS Spreadsheet and select the worksheet containing the SKUs.
- 2. Add helper columns: Add Parent SKU, Range, Color, Size, and SizeOrder columns, and fill the applicable values for every product row.
- 3. Rank the sizes: In SizeOrder, enter 1 for SIN, 2 for SMDBL, 3 for DBL, and 4 for KNG.
- 4. Sort the full list: Select the complete dataset, open Data > Sort, and add ascending levels for Parent SKU, Range, Color, and SizeOrder. Confirm that the header row is identified, then apply the sort.

Frequently Asked Questions
Why should I repeat product attributes on every component row?
Excel sorts individual rows using the values in each selected sort column. Repeating the parent SKU, range, color, and size gives every component row the keys needed to stay in the correct group.
Why not sort directly by the SKU column?
An SKU text sort follows the characters in the SKU, which may not match your desired size sequence. Use a numeric SizeOrder column as the final size sort key instead.
How can I keep a parent row above its children?
Add a RowOrder column with 0 for the parent and 1 for children, then add it as the final ascending level in Data > Sort. This puts the parent first among rows that share the preceding sort values.
What should I do if a product has a size outside the listed codes?
Choose where the additional size belongs in the sequence and give it an appropriate numeric rank in SizeOrder before running Data > Sort.




