How to Sort Rows by Column in Excel (4 Easy Methods)

Method 1 – Use Ascending (A-Z) or Descending (Z-A) Options to Sort Rows by Column in Excel

Method 1.1 – Sort Rows by Column from A-Z (Smallest to Largest)

First, we want to sort rows by column from smallest to largest. We need a data set for that. We can take this picture as a sample. It has column headers as ID Number, Name, Order 1, Order 2, and Order 3.

excel sort rows by column

  • Select the Dataset > open your Data tab > go to the “Sort & Filter” ribbon and click this icon

Using Ascending (A-Z) or Descending (Z-A) Options

  • We can see that the rows are sorted according to the columns.

excel sort rows by column


Method 1.2 – Sorting Rows by Column from Z-A (Largest to Smallest)

  • Select the ID Number
  • Open your Data tab > go to the Sort & Filter ribbon and click this icon

Using Ascending (A-Z) or Descending (Z-A) Options

  • Our rows are sorted with respect to the columns.

excel sort rows by column

Read More: How to Sort Data by Row not Column in Excel


Method 2 – Apply a Custom Sorting Method to Sort Rows by Column

Custom sorting is an amazing process of sorting your rows by column. Use the following dataset when applying this method:

Utilizing Custom Sorting Method to Sort Rows by Column

Steps:

  • Select your data range, go to “Data” and click this icon

excel sort rows by column

  • A window named Sort will appear.
  • Go to Options.

  • Another window will pop up named Sort Options.
  • Click on Sort Left to Right.

  • In the new window, sort by Row 4, sort on Cell Values and order is Largest to Smallest.
  • Click OK.

excel sort rows by column

All columns are now sorted based on the selections you made in the Sort dialog box.

Read More: How to Sort Alphabetically in Excel with Multiple Columns


Method 3 – Use a Multi-level Sorting Method to Sort Rows by Column in Excel

Steps:

  • Select your dataset, go to Data, and click this icon

Multi-level Sorting Method to Sort Rows by Column

  • When the Sort window opens, click on Option.
  • Choose Sort Left to Right from the new window.

excel sort rows by column

  • On the Sort window, click on Add Level to add another row to the existing sorted row. In the picture below we added two new levels (Row 5, Row 6).
  • Customize their style by their values and from Largest to Smallest.
  • Click OK.

  • Our rows are sorted by their column value.

Read More: How to Sort Multiple Columns in Excel Independently of Each Other


Method 4 – Apply SORT and SORTBY Functions in Excel

Steps:

  • Copy the column headers and paste them to the cell where you want to get your sorted values. In this case, it is cell H5.

Applying SORT and SORTBY Functions

  • Apply the “SORT” function in the H5 cell.
=SORT(B5:F16,3,1,FALSE)

Here,

  • “Array” is the selected Range or array to sort. (B5:F16)
  • [sort_index] is the Column index to use for sorting. The default is 1. We choose (3)
  • [sort_order] where, Ascending=1, Descending = -1. Default is ascending order. We choose (1)
  • [by_col] where, sort by column=TRUE , sort by row= FALSE . Default is FALSE. We choose

excel sort rows by column

  • Press “ENTER”.
  • Our rows are sorted.

  • Additionally, if we want to sort ID Number in Ascending order, we need to use the SORTBY function. So, write the following formula in the H5 cell.
=SORTBY(B5:F16,B5:B16)

excel sort rows by column

  • Press ENTER to see that the ID Numbers are sorted in Ascending order.

excel sort rows by column

Read More: How to Sort Alphabetically in Excel and Keep Rows Together


Things to Remember

➤ The “SORT” function is only available for “Excel 365”. You won’t be able to use this function unless you have this version of Excel.

➤ You can auto-sort columns by their value when you use the SORT function.

➤ When sorting, you need to select the header column cell.

➤ When you perform a multi-level custom sorting method, the data will first be sorted by the 1st level, then the 2nd level, and so on.


Download Practice Workbook

Download this practice sheet to practice while you are reading this article.


Related Articles


<< Go Back to Sort in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Asikul Himel
Asikul Himel

Asikul Islam Himel, holding a BSc in Naval Architecture and Marine Engineering from Bangladesh University of Engineering and Technology, has contributed over two years to the ExcelDemy project. Starting as an Excel & VBA Content Developer, now he manages projects at You Have Got This Math Project. He wrote 60+ articles for ExcelDemy, reviewed 500+, and focused on quality maintenance. Currently, his responsibilities include project management and team leadership. Himel's interests encompass data analysis, leadership, WordPress applications, and... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo