Back to Blog

How to Sort Data in Excel: Step-by-Step Guide | SheetXAI

D
David DeSouza
Dec 1, 2025
Vector illustration showing a person working on a laptop with two dashboard panels and upward arrows, representing organizing and sorting data in ascending or descending order

The Problem

You have a list of data in Excel (like sales numbers, names, or dates) and need to organize it in a specific order - from highest to lowest, alphabetically, or by date. Sorting helps you find information quickly and analyze trends.

The Easy Way: Use SheetXAI

If you don't want to manually sort data, the fastest way is to simply ask SheetXAI.

With SheetXAI, you can open the sidebar and type:

Sort the data in column A by values in column B, highest to lowest.

SheetXAI will instantly sort your data for you, handling all the sorting settings automatically. You can sort by multiple columns, dates, or custom criteria with simple commands.

The Manual Way: Step-by-Step Instructions

To sort data manually in Excel, follow these steps:

Step 1: Select Your Data

  1. Click on any cell within your data range
  2. Or select the entire range: Click and drag to select all the data you want to sort
  3. Include headers: Make sure to include the header row if you have one

Tip: If you just click a cell, Excel will automatically detect the data range when you sort.

Step 2: Open the Sort Dialog

  1. Click the Data tab in the ribbon
  2. Click Sort in the Sort & Filter group
  3. The Sort dialog box will appear

Step 3: Choose Your Sort Criteria

In the Sort dialog:

  1. Sort by: Choose the column you want to sort by (e.g., "Sales", "Name", "Date")
  2. Sort On: Choose what to sort on:
    • Values: Sort by cell values (most common)
    • Cell Color: Sort by cell background color
    • Font Color: Sort by text color
    • Cell Icon: Sort by conditional formatting icons
  3. Order: Choose the sort order:
    • A to Z or Smallest to Largest: Ascending order
    • Z to A or Largest to Smallest: Descending order
    • Custom List: Use a custom sort order

Step 4: Add Multiple Sort Levels (Optional)

To sort by multiple columns:

  1. Click Add Level in the Sort dialog
  2. Choose the second column to sort by
  3. Set the sort criteria for this level
  4. Repeat for additional levels

Example: Sort by Department (A to Z), then by Sales (Largest to Smallest) within each department.

Step 5: Configure Sort Options

Click Options in the Sort dialog to access:

  • Case sensitive: Sort uppercase before lowercase (usually unchecked)
  • Orientation: Sort by rows or columns (usually "Sort top to bottom")
  • My data has headers: Check this if your first row contains headers

Step 6: Apply the Sort

  1. Click OK in the Sort dialog
  2. Your data will be sorted according to your criteria
  3. The sort order is permanent (until you sort again)

Quick Sort (One Column)

For a quick sort on a single column:

  1. Click on any cell in the column you want to sort by
  2. Click Data tab → Sort A to Z (ascending) or Sort Z to A (descending)
  3. Excel will ask if you want to expand the selection - click Expand the selection to sort the entire table

Keyboard shortcuts:

  • Alt + A + S + A: Sort A to Z (ascending)
  • Alt + A + S + D: Sort Z to A (descending)

Sorting Dates

To sort by dates:

  1. Select your data
  2. Open Sort dialog
  3. Choose the date column
  4. Sort On: Values
  5. Order:
    • Oldest to Newest: Chronological order
    • Newest to Oldest: Reverse chronological order

Excel automatically recognizes date formats and sorts them chronologically.

Sorting Numbers

To sort numbers:

  1. Select your data
  2. Open Sort dialog
  3. Choose the number column
  4. Sort On: Values
  5. Order:
    • Smallest to Largest: Ascending (1, 2, 3...)
    • Largest to Smallest: Descending (100, 99, 98...)

Sorting Text

To sort text alphabetically:

  1. Select your data
  2. Open Sort dialog
  3. Choose the text column
  4. Sort On: Values
  5. Order:
    • A to Z: Alphabetical
    • Z to A: Reverse alphabetical

Common Mistakes to Avoid

  1. Not selecting all columns: When sorting, make sure all related columns are included, or Excel will only sort one column and break your data relationships
  2. Forgetting headers: Always check "My data has headers" if your first row contains column names
  3. Sorting formulas: Be careful when sorting cells with formulas - the formulas will move with the data, which might break references
  4. Partial selection: Don't select just one column when you have multiple columns - select the entire table
  5. Undoing sort: Once sorted, you can't easily "unsort" - consider making a backup copy first

Tips for Better Sorting

  • Backup first: Make a copy of your data before sorting important information
  • Use multiple levels: Sort by multiple columns to organize complex data
  • Freeze headers: Use Freeze Panes to keep headers visible when scrolling sorted data
  • Convert to table: Convert your data to an Excel Table (Ctrl+T) for easier sorting and filtering
  • Use SheetXAI for complex sorts: For complex sorting criteria or multiple conditions, SheetXAI can handle it automatically

Sorting with Excel Tables

For easier sorting, convert your data to a table:

  1. Select your data
  2. Press Ctrl+T (Windows) or Cmd+T (Mac)
  3. Check "My table has headers" if applicable
  4. Click OK
  5. Click the dropdown arrow in any column header
  6. Choose Sort A to Z or Sort Z to A

Tables make sorting easier and maintain data relationships automatically.

Custom Sort Orders

To create a custom sort order (e.g., sort by days of week, months, or priority levels):

  1. Open Sort dialog
  2. Choose your column
  3. In Order, select Custom List
  4. Choose a built-in list or create your own
  5. Click OK

Conclusion

Now you know how to sort data in Excel manually. It's a fundamental skill for organizing and analyzing data.

But for those times when you need to sort by complex criteria or multiple columns, SheetXAI can sort your data automatically with simple commands, saving you time and ensuring accurate results.

Boost your productivity today.
Start automating your spreadsheets.

Join thousands of professionals saving hours every week. No credit card required to start.

Learn more