When your table contains data that is best presented in alphabetical or numerical order, sort it.
Note: These instructions are for Word and Excel. The sort option is not available in PowerPoint.
Sorting data in Excel tables is an essential skill for organizing and analyzing information. With a few clicks, you can rearrange table rows and columns to gain insights, spot trends and patterns, and make data-driven decisions.
As a spreadsheet expert, I often get asked – how do you sort tables in Excel? Well, this comprehensive guide will walk you through the various ways to sort table data using the user interface or keyboard shortcuts. Whether you want to arrange text alphabetically, order numbers from largest to smallest, or sort by color, icons and more – these tips will help you do it all!
Why Sort Tables in Excel?
Before we dive into the step-by-step instructions. let me quickly explain why sorting tables is so important
-
Spot Trends – Sorting brings related data points together making it easier to identify trends and outliers. For example, sorting sales data from highest to lowest immediately shows your top-performing products.
-
Find Data Quickly – Sorting arranges data logically allowing you to locate information faster without endless scrolling.
-
Organize Data – Sorting tidies up disorganized data and arranges it in a structured way for easier visualization and analysis.
-
Simplify Analysis – Sorted data simplifies tasks like highlighting duplicates, adding subtotals, and filtering. It takes fewer steps to analyze organized data.
-
Present Data – A sorted table is often easier to understand and convey insights when presented to others.
Now that you’re convinced, let’s get into the various ways to sort table data in Excel.
Sort an Excel Table by Column
The most common way to sort tables is by an entire column. Follow these simple steps:
-
Select any cell in the column you want to sort by.
-
Go to the Data tab > Sort.
-
Pick one of the sort buttons:
-
A-Z to sort alphabetically from A to Z
-
Z-A to sort reverse alphabetically from Z to A
-
Smallest to Largest for numbers
-
Largest to Smallest for numbers
-
Oldest to Newest for dates
-
Newest to Oldest for dates
-
That’s it! The entire table will be sorted according to the selected column. The sort order will be marked with an upward or downward arrow in the column header.
Sort Numbers Correctly
If you don’t get the expected results when sorting numbers, here are some tips:
-
Format the cells as Numbers instead of General or Text. This stores them as actual values instead of text strings.
-
Remove any spaces, currency symbols or percent signs before sorting. Use the VALUE or CLEAN function if needed.
-
Check for numbers stored as text. Fix them by converting to numbers.
Sort Dates Properly
To correctly sort dates:
-
Confirm the cells are formatted as Dates and not Text. Switch to a date format like m/d/yyyy.
-
Check for dates entered as text. Convert them to serial date numbers.
-
Verify your Windows regional settings are correct. Different locales can sort dates differently.
Sort an Excel Table by Multiple Columns
To take your sorting skills up a notch, you can organize an Excel table by up to 64 columns in the order you specify.
Let’s see how to sort by Department, then Name:
-
Select any cell in your data table.
-
Go to Data > Sort.
-
In the first Sort by box, pick the Department column.
-
Choose A-Z or Smallest to Largest order.
-
Click Add Level.
-
In the Then by box, choose the Name column.
-
Pick A-Z order.
-
Click OK.
The table will now sort by Department first, then alphabetically by Name within each department. Use the Up/Down buttons to change the sort order of the columns if needed.
With this custom sorting, you can arrange the data in any order you want!
Sort an Excel Table by Row Instead of Column
While less common, you can sort tables by rows instead of columns. This organizes your data horizontally from left to right.
To sort by row:
-
Select any cell in your table.
-
Go to Data > Sort.
-
In the Sort dialog box, click Options.
-
Select Sort left to right.
-
Pick the row you want to sort by.
-
Choose the order (A-Z, Smallest to Largest, etc).
-
Click OK.
This will rearrange your table data row-wise from left to right. Remember to unhide any hidden rows first for accurate sorting.
Sort Excel Tables by Color, Icon and More
Tired of the usual sorting methods? You can get creative and customize the sort order in other ways:
-
Cell Color – Sort by cell background fills. Pick the colors in the order you want.
-
Font Color – Sort by font colors in a specific sequence.
-
Cell Icon – Sort by icon sets applied through conditional formatting.
-
Custom List – Sort by a predefined custom order like High-Med-Low.
Let’s see how to sort by cell color:
-
Select the column to sort.
-
Go to Data > Sort.
-
Under Sort On, pick Cell Color.
-
Choose the order of colors to sort by.
-
Select the final order like On Bottom or On Top.
-
Click OK.
The table will rearrange with the chosen cell colors in the defined order. Use Add Level for secondary colors.
Sorting by font, icons or custom lists works the same way!
Case-Sensitive Sorting in Excel Tables
By default, Excel sorting is case-insensitive. This means UPPERCASE and lowercase text is treated as identical.
To sort case-sensitive text:
-
Go to Data > Sort.
-
Click on Options.
-
Check the Case sensitive checkbox.
-
Click OK twice.
Now uppercase and lowercase text will be sorted distinctly. Ant will come before ant!
Sort Part of an Excel Table
You can sort just part of a table while keeping the rest intact. But this is risky without due care.
For example, if you sort only rows 5-10 alphabetically, you’ll completely disassociate that chunk from the larger data set. The sorted rows will no longer align with the original table.
Instead, I recommend one of the following safer approaches:
-
Split the data into another table using Remove Duplicates. Then sort it separately.
-
Copy the partial data you want to sort into a new location. Sort this copied data.
-
Add a helper sorting column with a formula or custom sort order. Sort by this column.
The key is keeping the original table intact to avoid scrambling your data incorrectly.
Sort Tables with Filters or Slicers Applied
If filters or slicers are currently applied to your Excel table, take note:
-
Sorted columns will reorder only the visible data based on the filters. Hidden rows will remain static.
-
Filters and slicers will remain applied after sorting. They dynamically adapt to the new order.
-
However, copy-pasted filtered data will not retain filters. You must reapply after sorting.
Quickly Sort Tables With Keyboard Shortcuts
For power users, Excel provides handy keyboard shortcuts to sort tables in a flash:
| Shortcut | Action |
|---|---|
| ALT + A, Z | Sort column A to Z |
| ALT + Z, A | Sort column Z to A |
| ALT + S, L | Sort column smallest to largest |
| ALT + L, S | Sort column largest to smallest |
| ALT + O, N | Sort column oldest to newest |
| ALT + N, O | Sort column newest to oldest |
Select the column, then use the relevant shortcut to instantly sort!
Sort Tables in the Excel Web App
The Excel web app has limited sorting functionality compared to the desktop app. But you can still sort single columns:
-
Select the column header.
-
Choose Sort Ascending or Sort Descending from the pop-up menu.
For multi-column sorting, cell colors, custom lists etc. you will need the desktop app. The web app supports basic single column sorts only.
Common Excel Table Sorting Problems
Here are some common hiccups faced when sorting tables:
-
#VALUE! errors – Check for invalid data, verify calculation settings are set to automatic.
-
Wrong sort orders – Confirm data formatting is consistent and accurate, such as numbers not stored as text.
-
Cell width changes – Sorting can resize cell widths. You may need to manually adjust columns.
-
Relationships broken – Sorting part of a table can scramble relationships between rows/columns.
-
Filters not sorting – Hidden rows remain static. Unhide filtered data for correct sorting

Sort a table in Word
- Select anywhere in the table.
- Select Table Tools Layout > Sort.
- Choose your sort criteria:
- Select the column you want to Sort by.
- To sort on a second column, select Then by and select another column.
- Select Ascending or Descending.
- To keep the header row at the top of the table, select Header row.
- Select OK.
Sorting in Excel – Basics and Beyond
How to sort data in Excel?
In the Sort box, set up your first sort option with the drop-down boxes. Then, choose “Add Level” and set up the secondary sort you want to use. Keep in mind that, Excel sorts your data based on this list of levels from top to bottom. So if needed, you can rearrange them. Select a level and then use the arrow buttons to move that level up or down.
How do I sort a table?
• Finally, when you click a filter button in a table, you’ll see sorting commands at the top. When a filter is enabled on a table, the sorting commands there are probably the most convenient to use. However, the sort buttons on the Data tab are also handy, because you have dedicated buttons for sorting in ascending and descending order.
How do I sort a column in Excel?
Select Custom Sort. Select Add Level. For Column, select the column you want to Sort by from the drop-down, and then select the second column you Then by want to sort. For example, Sort by Department and Then by Status. For Sort On, select Values. For Order, select an option, like A to Z, Smallest to Largest, or Largest to Smallest.
How to sort a table in Excel using multiple columns?
To sort a table in Excel using multiple columns, first click into the table. Then click the “Sort” button in the “Sort & Filter” button group on the “Data” tab in the Ribbon. In the “Sort” dialog box that appears, use the first “Sort by” drop-down to select the name of the first column by which to sort a table in Excel.