Yes. To sort entire rows by one column in Excel for Microsoft 365 on Windows, select the full data range, go to Data > Sort, choose the column under Sort by, and select the order. Sorting the whole range keeps each row’s related values together; sorting only the one column can scramble the records.
Why you need to select the entire data range
A spreadsheet row often represents one record: a person and their email address, an order and its date, or a product and its price. The values across that row belong together. If you sort just the names or prices in one column, Excel may rearrange those cells without moving the corresponding values in other columns. The result can look tidy while quietly assigning the wrong details to each record.
For example, imagine a table with columns for Employee, Department, and Start Date. If you sort only the Department column alphabetically, the employee names and dates stay where they were. Instead, sort the complete table range, such as A1:C20, using Department as the sort key. Excel then moves each row as a unit.
The key distinction is between the sort range, which contains all the cells that should move together, and the sort key, the column Excel uses to decide the order. The range can span several columns, while the sort key is just one of them.
Sort complete rows with the Sort dialog
The Sort dialog gives you the clearest control over the range, header row, sort column, and order. Use it when your data has several columns or when you want to avoid any ambiguity about what Excel will move.
- Select the full rectangular range of your data, including every column that belongs to the records. Include the header row if there is one. For example, select A1:D50 to sort four columns and 49 records.
- Choose Data > Sort on the ribbon. Excel opens the Sort dialog.
- If the first row contains headings, check My data has headers. This tells Excel to treat that row as labels rather than as a record to sort.
- In Sort by, select the heading of the column you want to use. If the range has no headers, select the relevant column label, such as Column C.
- Set Sort On to Cell Values for an ordinary text, number, or date sort. Choose the order, such as A to Z, Smallest to Largest, or Oldest to Newest.
- Click OK and check a few rows to confirm that related values moved together and that the order is what you intended.
For instance, if A1:C4 contains headers Name, Score, and Region, selecting A1:C4 and sorting by Score from smallest to largest moves each name and region along with its score. A sort by text usually offers A to Z or Z to A; a numeric column offers smallest to largest or largest to smallest; and dates can be ordered oldest to newest or newest to oldest.
What to do if Excel asks to expand the selection
If you select one column and click a sort button, Excel may show a warning asking whether to expand the selection or continue with the current selection. Choose Expand the selection when the neighboring columns are part of the same records. This tells Excel to move those cells along with the sorted column.
Choosing Continue with the current selection sorts only the selected cells. That option is appropriate only when those cells are meant to be independent of adjacent data. For a normal table, expanding the selection is the safer choice. You can avoid the warning altogether by selecting the complete range first and using Data > Sort.
Do not rely only on Excel’s guess about where a data block starts and ends when the sheet has blank columns, blank rows, notes nearby, or other separate data. Select the intended range yourself. That makes clear which records should move and helps prevent unrelated cells from being included.
Sort an Excel table by one column
If your data is formatted as an Excel table, sorting by a column is straightforward. Click a cell in the table, then use the filter arrow in the heading of the column you want to sort. Choose Sort A to Z or Sort Z to A for text, or the corresponding smallest-to-largest or oldest-to-newest option for numbers and dates. Excel sorts the table’s rows together.
To turn an ordinary range into a table, select the data and choose Insert > Table. Confirm the range and indicate whether it has headers. Tables provide filter arrows in their headings and automatically extend to include many new rows or columns added next to the table. They can make regular sorting and filtering easier, but they do not change the basic rule: the sort column determines the order, and the other table columns travel with each row.
For a table with several sort levels—for example, Department first and Start Date second—use Data > Sort and add a level in the dialog. Excel applies the first level, then uses the next level to order records that tie on the first. This is useful for grouped lists, such as sorting by department and then arranging employees within each department by hire date.
Headers, blanks, and data types to check
Headers should be included in the selected range and identified as headers in the Sort dialog. If you leave My data has headers unchecked for a range that includes headings, Excel may sort the headings into the records. If you check it when the range has no heading row, Excel can treat the first actual record as a header and leave it out of the sort. Check the setting before confirming.
Blank cells do not necessarily mean the end of a record, but completely blank rows can make it harder to select a continuous block accurately. If a blank row divides a list, select the entire intended range manually rather than assuming Excel will include both sections. Also check whether blank values should appear at the beginning or end of the resulting order; their placement can depend on the sort type and direction.
Numbers and dates that are stored as text may not sort in the order you expect. Text values that look like numbers can sort alphabetically—for example, 100 may appear before 20—while genuine numeric values sort by magnitude. Dates stored as text can also sort as words rather than as dates. If the order looks wrong, check the cells’ underlying values and data types, not just how they are displayed.
- Keep all columns for a record inside the selected sort range.
- Check for hidden rows, merged cells, or separate notes beside the list before sorting.
- Use consistent values in the sort column, such as real dates throughout rather than a mixture of dates and date-like text.
- If the data has multiple sort levels, set those levels in the Sort dialog instead of sorting one column repeatedly without a plan.
Use a formula to show a sorted copy
If you want the original data to remain in its existing order, a formula can display a sorted copy elsewhere. In Microsoft 365, the SORT function returns an array that spills into neighboring cells. It is an alternative for creating a view of sorted data, not a command that rearranges the original rows in place.
With names in A2:A5, scores in B2:B5, and regions in C2:C5, the complete source range is A2:C5. The formula below sorts that range by its second column, the scores, in ascending order:
=SORT(A2:C5,2,1)
For example, if the four rows are Lee, 88, West; Morgan, 72, East; Patel, 95, North; and Chen, 81, South, the displayed order is Morgan, Chen, Lee, Patel, with scores 72, 81, 88, and 95 and each original region beside its matching name. The formula’s second argument, 2, means the second column of the supplied range; the third argument, 1, means ascending order. Use -1 for descending order.
Leave enough empty cells below and to the right of the formula for its results to spill. If something occupies that output area, Excel can show a spill error instead of displaying the sorted array. SORT is available in Microsoft 365 and Excel 2021 or later. A formula-based result is useful for a live sorted view, but it does not carry the source cells’ formatting as a full interactive sort would. If you need to change the original list’s order, use the Sort dialog instead.
Common sorting problems and how to fix them
Only one column moved. Undo immediately with Ctrl+Z on Windows, then select the full range and sort again. On Mac, use Command+Z. If you have made other changes since the sort, review them before undoing so you do not remove unrelated work.
The heading is mixed into the records. Open Data > Sort, verify that the full range is selected, and check My data has headers. If the range has no headings, leave that option unchecked.
The order looks nonsensical. Inspect the sort column for mixed types, leading or trailing spaces, inconsistent spelling, or values that are stored as text. For example, separate entries such as North, north, and North with an extra space may not behave as a reader expects. Clean or standardize the values if you need consistent grouping.
Some rows did not move. Confirm that they were inside the selected range. A blank row or blank column may have caused Excel to identify only part of the data. Select the full block explicitly and sort again. Also check whether the rows are filtered or hidden, since that can affect what is visible while you work.
The result is correct but looks different. A sort changes row order, not the underlying values. If the column contains duplicate keys, their relative order may not provide a meaningful tie-breaker unless you add a second sort level. To get a repeatable order among ties, add another level such as surname, date, or ID.
Frequently Asked Questions
How do I sort rows in Excel without mixing up the data?
Select every column in the records, then choose Data > Sort and set the desired column as Sort by. Do not sort just the key column unless its cells are intentionally independent from the other columns.
Can I sort an entire row based on one cell?
Yes. Select the full data range and sort by the column containing that cell’s values. Excel uses the selected column to order records and moves the other cells in each selected row with it.
How do I sort by a column without including the header?
Include the header in the selected range, then check My data has headers in Data > Sort. Excel will use the heading as a label and sort the data rows beneath it, rather than moving the heading as a record.
Can I sort by two columns?
Yes. In Data > Sort, set the primary column, then choose Add Level to specify a secondary column. For example, sort by Department first and by Last Name second to alphabetize names within each department.
Does sorting change the original data when I use SORT?
No. The SORT formula displays a sorted array in another area; it leaves the source range in its original order. Use Data > Sort when you want to reorder the source data itself.
Choosing the right sorting method
Use the Sort dialog when you need to rearrange the original records, control headers, or set multiple sort levels. Use a table’s heading arrow for a quick sort of a structured list. Use SORT when you want a separate, automatically updated sorted view and have Microsoft 365 or Excel 2021 or later. Whichever method you choose, decide the complete record range first. That single step is what keeps each row’s information together.
Related
- Excel Not Updating Links From Other Workbooks? Fixes
- Excel Not Keeping Formatting? Causes and Fixes
- Excel Not Blank Conditional Formatting: How to Set It Up
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Excel Formula for File Path: Get the Workbook LocationIn Excel for Microsoft 365 on Windows, use =CELL("filename",A1) to return the saved workbook’s path, file name, and…
- Excel Protect Sheet From Being Deleted: The Right SettingTo stop a worksheet from being deleted in Excel for Microsoft 365 on Windows, protect the workbook’s structure:…
- Excel SUMIF: Sum Columns When a Cell Contains TextTo add values in one column only when the corresponding cell in another column is exactly x, use…
- Excel ABS Function: How to Return a Positive ValueTo turn a negative number into a positive one in Excel, use the ABS function: it returns the…
- Match Excel Formula for Two Columns: Compare ValuesTo compare two cells on the same row in Excel, enter =IF(A2=B2,"Match","Different") in C2 and fill it down.…
- Excel TEXT Function Format Options and Examples ExplainedExcel’s TEXT function converts a number, date, or time into text displayed with a format code: use =TEXT(value,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.