Sort Excel Columns by Surname Without Separating Rows
Question details
Sort names and addresses alphabetically by surname while keeping related information in the same rows.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains surnames, names, and addresses in separate columns that need to be sorted together.
- Observed behavior
- Sorting only the surname column can move surnames away from their associated names and addresses.
Identify the surname column and all columns containing related information. Check whether the first row contains headers so you can set the sort options correctly.
Sort the complete Excel data range by surname
Use Excel's Sort dialog to reorder all related columns together and optionally sort matching surnames by another field.
Select the complete range containing surnames, names, addresses, and any other columns that belong to the same records. Include the header row if there is one.
Go to Data > Sort. If a sort warning appears, choose Expand the selection so that related columns move together.
Check My data has headers if the selected range includes column headings. Under Sort by, select the Surname column, and choose A to Z for the order.
Click Add Level and select Name, Address, or another column to order records with the same surname. Click OK to apply the sort.

Sort names and addresses together in WPS Spreadsheet
Use WPS Spreadsheet to select the full data range and sort it by surname while keeping names and addresses in their original rows.
- 1. Open the spreadsheet: Open WPS Spreadsheet and use File > Open to select your workbook.
- 2. Select the complete range: Select the surname, name, address, and any other related columns, including their headers if present.
- 3. Set the sort order: Go to Data > Sort, indicate whether the selection has headers, and select Surname as the sort column with ascending or A to Z order.
- 4. Apply the sort: Add a secondary sort level if needed, then click OK to sort the selected rows together.

Frequently Asked Questions
How do I keep addresses matched to names when sorting?
Select all related columns before choosing Data > Sort. Set Surname as the sort field so Excel moves each selected row together.
What should I do if Excel asks whether to expand the selection?
Choose Expand the selection when the neighboring columns contain information belonging to the same records, then continue with the sort.
How can I sort people with the same surname by first name?
In Data > Sort, select Surname as the first level, then click Add Level and choose the first-name column as the second level.
Will the column headings be sorted with the data?
If your selected range includes headings, check My data has headers in Excel's Sort dialog. Excel will use the headings as column names rather than sorting them as records.




