0
0
ExcelHow-ToBeginner ยท 4 min read

How to Sort Data in Excel Quickly and Easily

To sort data in Excel, select the cells or table you want to sort, then go to the Data tab and click Sort. Choose the column to sort by and select ascending or descending order, then click OK to reorder your data.
๐Ÿ“

Syntax

Excel sorting is done through the Sort feature in the Data tab. You can sort by one or more columns, choosing ascending (A to Z or smallest to largest) or descending (Z to A or largest to smallest) order.

For formula-based sorting, you can use the SORT function with this syntax:

  • =SORT(array, [sort_index], [sort_order], [by_col])

Where:

  • array is the range or array to sort.
  • sort_index is the column (or row) number to sort by (default 1).
  • sort_order is 1 for ascending or -1 for descending (default ascending).
  • by_col is TRUE to sort by column, FALSE to sort by row (default FALSE).
excel
=SORT(A2:C10, 2, 1)
Output
Returns the range A2:C10 sorted by the 2nd column in ascending order.
๐Ÿ’ป

Example

This example shows how to sort a list of names and scores by score in descending order using the SORT function.

excel
Original data in A1:B5:
Name    Score
Anna    85
Ben     92
Cara    78
Dave    90

Formula in D1:
=SORT(A2:B5, 2, -1)

Result in D1:E4:
Ben     92
Dave    90
Anna    85
Cara    78
Output
Sorted list by Score descending: Ben 92, Dave 90, Anna 85, Cara 78
NameScore
Ben92
Dave90
Anna85
Cara78
โš ๏ธ

Common Pitfalls

Common mistakes when sorting data in Excel include:

  • Not selecting the entire data range, causing only part of the data to sort and misalign rows.
  • Sorting only one column without expanding selection, which breaks data relationships.
  • Forgetting to include headers in the selection or not checking the "My data has headers" box.
  • Using the SORT function without understanding it creates a new sorted array and does not change original data.
excel
Wrong way:
Select only column A and sort.

Right way:
Select all columns of your data before sorting or use the Sort dialog and check "My data has headers".
๐Ÿ“Š

Quick Reference

ActionDescription
Select DataHighlight the full range including all columns and rows to sort.
Go to Data TabClick the Data tab on the ribbon.
Click SortOpen the Sort dialog to choose sorting options.
Choose ColumnSelect the column to sort by.
Select OrderPick ascending or descending order.
ConfirmClick OK to apply the sort.
Use SORT FunctionUse =SORT(range, column, order) for dynamic sorting.
โœ…

Key Takeaways

Always select the entire data range before sorting to keep rows intact.
Use the Data tab's Sort feature for manual sorting with multiple columns.
The SORT function creates a new sorted list without changing original data.
Check 'My data has headers' to avoid sorting header rows.
Choose ascending or descending order based on your sorting needs.