Data Import & Export

Sort Excel Columns by Surname Without Separating Rows

Huda QurayshiHuda Qurayshi Nov 14, 2026 869 views

Question details

Sort names and addresses alphabetically by surname while keeping related information in the same rows.

Sort Excel Columns by Surname Without Separating 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.
Before you start

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.

Solution 1Recommended

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.

1
Select the related data

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.

2
Open the Sort dialog

Go to Data > Sort. If a sort warning appears, choose Expand the selection so that related columns move together.

3
Choose the surname order

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.

4
Add a secondary sort if needed

Click Add Level and select Name, Address, or another column to order records with the same surname. Click OK to apply the sort.

Sort the complete Excel data range by surname
Keep records together: Do not sort only the surname cells without expanding the selection, or the surnames can become mismatched with the other columns.
Sort spreadsheet records in WPS

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. 1. Open the spreadsheet: Open WPS Spreadsheet and use File > Open to select your workbook.
  2. 2. Select the complete range: Select the surname, name, address, and any other related columns, including their headers if present.
  3. 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. 4. Apply the sort: Add a secondary sort level if needed, then click OK to sort the selected rows together.
Sort complete records by surname without separating related columnsAdd another sort level to organize matching surnamesOpen and work with Microsoft Excel XLSX and XLS filesUse a familiar spreadsheet interface for everyday data tasks
microsoft office alternative - wps office

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.