How to Sort Numbers in Excel (8 Quick Ways)

We’ll use a sample dataset that contains the salary information of a particular employee with the Employee Name, Region, and Salary columns.

Sample Dataset of Excel Sort Numbers


How to Sort Numbers in Excel (8 Easy Ways)


Method 1 – Sort Numbers from Smallest to Largest in Excel

  • Select the cell range that contains numbers. We selected the cell range D4:D13.
  • Open the Home tab.
  • Go to Editing.
  • From Sort & Filter, select Sort Smallest to Largest.

Sort Numbers from Smallest to Largest in Excel

  • A dialog box will pop up. Select Expand the selection.
  • Click on Sort.

  • This will Sort the numbers in the ascending order by moving entire rows around.

Sort Numbers from Smallest to Largest in Excel

Read More: How to Arrange Numbers in Ascending Order with Excel Formula


Method 2 – Sort Numbers from Largest to Smallest in Excel

  • Select the cell range that contains numbers. We selected the cell range D4:D13.
  • Open the Home tab.
  • Go to Editing.
  • From Sort & Filter, select Sort Smallest to Largest.

Sort Numbers from Largest to Smallest in Excel

  • A dialog box will pop up. Select Expand the selection.
  • Click on Sort.

  • This will Sort the numbers in descending order along with the adjacent cell values.

Sort Numbers from Largest to Smallest in Excel


Method 3 – Sort Numbers Based on Criteria in Excel

  • Select the cell range that contains numbers. We selected the cell range D4:D13.
  • Open the Home tab.
  • Go to Editing.
  • From Sort & Filter, select Custom Sort.

Sort Numbers Based on Criteria in Excel 

  • A dialog box will pop up. Select Expand the selection.
  • Click on Sort.

  • Another dialog box will pop up. Click on Add Level
  • In Sort by, select the Column name to sort first. We chose the Region column in Sort by selected A to Z.
  • In Then by, select the Column which contains the numbers. We selected the Salary($) column in Then by and chose Smallest to Largest.
  • Click on OK.

Sort Numbers Based on Criteria in Excel 

  • This will Sort the values based on the Region column (alphabetically from A to Z), then in ascending order within each region.

You can also Sort numbers by region and then in the descending order.

  • Choose the Region column in Sort by and, in Order, select A to Z.
  • Choose the Salary($) column in Then by and, in Order, select Largest to Smallest.
  • Click on OK.

Sort Numbers Based on Criteria in Excel 

  • Here are the results.

You can use the Sort command from the Data tab to use Custom Sort. Open the Data tab and select Sort.

Read More: How to Put Numbers in Numerical Order in Excel


Method 4 – Using Excel Formula to Sort Numbers in Ascending Order

  • We named the range D4:D13 as data_1.

Using Excel Formula to Sort Numbers in Ascending Order

  • Select any cell to place the resulting value. We selected cell F4.
  • Insert the following formula.
    =SMALL(data_1,ROWS($D$4:D4))

The SMALL function will extract the Smallest number from the given range of data.

  • Press Enter.

Using Excel Formula to Sort Numbers in Ascending Order

Here, all the numbers are sorted in ascending order.


Method 5 – Using Excel Formula to Sort Numbers in Descending Order

  • We named the range D4:D13 as data_2.

Using Excel Formula to Sort Numbers in Descending Order

  • Select any cell to place the results. We chose the cell F4.
  • Insert the following formula.
=LARGE(data_2,ROWS($D$4:D4))

  • Press Enter.

Using Excel Formula to Sort Numbers in Descending Order

  • Use the Fill Handle to AutoFill the formula for the rest of the cells.


Method 6 – Sort Numbers Using the  Context Menu

We added two columns, Tax to Pay and Tax Percentage, to show you how different Number Formats work while Sorting.

Sort Numbers Using Excel Context Menu

  • Select the cell range from which you want to sort the numbers. We selected the cell range F4:F13.
  • Right-click and choose Sort, then select Sort Largest to Smallest.

  • A dialog box will pop up. Select Expand the selection.
  • Click on Sort.

Sort Numbers Using Excel Context Menu

  • This will Sort the numbers in descending order along with the adjacent cells’ values.

Sort Numbers Using Excel Context Menu

Read More: How to Sort Duplicates in Excel


Method 7 – Using the A→Z Command to Sort Numbers from Smallest to Largest

  • Select the cell range that contains numbers. We selected the cell range D4:D13.
  • Open the Data tab and select A→Z

Using A→Z Command to Sort Numbers Smallest to Largest

  • A dialog box will pop up. Select Expand the selection.
  • Click on Sort.

  • This will Sort the numbers in the ascending order along with the adjacent cell values.

Using A→Z Command to Sort Numbers Smallest to Largest

Read More: How to Sort Merged Cells of Different Sizes in Excel


Method 8 – Using the Z→A Command to Sort Numbers from Largest to Smallest

  • Select the cell range that contains numbers. We selected the cell range D4:D13.
  • Open the Data tab and select Z→A

Using Z→A Command to Sort Numbers Largest to Smallest

  • A dialog box will pop up. Select Expand the selection.
  • Click on Sort.

  • This will Sort the numbers in descending order along with the adjacent cell values.

Using Z→A Command to Sort Numbers Largest to Smallest

Read More: How to Sort Merged Cells in Excel


Things to Remember

While using Custom Sorting, remember to check the My data has headers option.

If you don’t want to change your data, select the Expand the selection option while sorting. Otherwise, only the selected values get sorted, which makes the data unusable since the surrounding data won’t match it.


Practice Section

We’ve provided a practice sheet to practice the explained methods.


Download the Practice Workbook


How to Sort Numbers in Excel: Knowledge Hub


<< Go Back to Sort in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Shamima Sultana
Shamima Sultana

Shamima Sultana, BSc, Computer Science and Engineering, East West University, Bangladesh, has been working with the ExcelDemy project for 2 years. She has written over 75+ articles and reviewed 1000+ articles for ExcelDemy. She has also led several teams with Excel VBA and Content Development works. Currently, she is working as the Project Manager and oversees the day-to-day work, leads the services team, allocates resources to the right area, etc. Her work and learning interests vary from Microsoft... Read Full Bio

2 Comments
  1. arrangement a 4 digit number in a row from lowest to highest.
    What`s the formula ?

    • Dear SATHI,
      Thank you very much for reading this article. Here, you have a query to arrange a 4-digit number in a row from the lowest to highest using a formula. We have found a solution for your mentioned problem in the below section.
      ● Look at the below image.

      Insert number for sorting in Excel

      A four-digit number is inserted in the dataset.
      ● First, we will separate the digits of the inserted number using the following formula.
      =MID($B5,COLUMN()-(COLUMN($E4)- 1),1)

      Separate numbers before sorting

      We use the combination of the MID and COLUMN function.

      Formula Explanation:

      COLUMN($E4)
      This will return the column number of the reference.
      Result: 5
      ● COLUMN($E4)-1
      We will subtract 1 from the column number.
      Result: 4
      ● COLUMN()
      It returns the column number of the inserted cell.
      Result: 5
      ● COLUMN()-(COLUMN($E4)-1)
      A subtraction operation will apply here.
      Result: 1
      ● MID($B5,COLUMN()-(COLUMN($E4)- 1),1)
      The MID function will operate here.
      Result: 6

      ● Now, we will sort the separated numbers using the formula based on the SORT function.
      =SORT($E$4:$H$4, ,1,TRUE)

      Use SORT function for sorting numbers
      You can also download the following Excel file for practice.
      Solution Excel Sort Numbers.xlsx

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo