
How to Sort Data in Microsoft Excel
How to Sort Data in Microsoft Excel
Sorting is one of the most fundamental data operations in Excel. Whether you are alphabetizing a contact list, ranking sales by amount, or putting dates in chronological order, sorting makes your data immediately more readable and usable. Here is everything you need to know.
Quick Sort: One Click
The fastest way to sort is with the sort buttons on the Home tab (in the Editing group) or the Data tab. Click any cell in the column you want to sort by, then click A-Z (ascending) or Z-A (descending). Excel sorts the entire table based on that column while keeping all rows intact.
Sorting Text
Text sorts alphabetically — A to Z places Aaron before Brian; Z to A reverses this. Text sort is case-insensitive by default, so apple and Apple are treated the same. For case-sensitive sorting, you need to use a custom sort with Options checked.
Sorting Numbers
Numbers sort numerically. Ascending order goes smallest to largest; descending goes largest to smallest. A common pitfall: numbers stored as text sort incorrectly (lexicographically, so 10 comes before 9). Check the format of your numbers if the sort order looks wrong.
Sorting Dates
Dates sort chronologically. Ascending goes earliest to latest; descending goes latest to earliest. Again, dates stored as text rather than actual date values will sort incorrectly — they will sort alphabetically instead of chronologically.
Sort by Cell Color or Icon
Excel can sort by cell background color, font color, or conditional formatting icon. Click the Data tab, open the full Sort dialog, and change the Sort On dropdown from Cell Values to Cell Color, Font Color, or Cell Icon. Put your most important color at the top.
Undoing a Sort
Press Ctrl + Z immediately after sorting to undo it. If you need to return to an original order after multiple operations, add an index column (numbered 1, 2, 3...) before sorting. You can always sort by that index column to restore the original sequence.