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

If you are looking for how to sort rows by column in Excel, then you are in the right place. When you are dealing with a large amount of datasets, searching, organizing, keeping them in a specific cell, and tracking the specific data becomes more complicated. To avoid this situation, excel has an amazing feature called “sorting”. Using this feature you can sort your data by column, value, dates, or any other special conditions. It will help you to quickly understand, find, and visualize your data and will make your action faster. In this article, we will discuss how to sort rows by column in Excel.


1. Using Ascending (A-Z) or Descending (Z-A) Options to Sort Rows by Column in Excel

In most common cases we need to sort rows from smallest to largest (A-Z) or from largest to smallest (Z-A) by column. We can do it by following these easy steps.

1.1. Sorting 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

  • Secondly, 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

  • Eventually, we can see that the rows are sorted according to the columns.

excel sort rows by column


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

Now we will sort rows by column from largest to smallest (Z-A).

  • To do this, firstly, select the ID Number
  • Secondly, open your Data tab > go to the Sort & Filter ribbon and click this icon

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

  • Consequently, 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


2. Applying Custom Sorting Method to Sort Rows by Column

Custom sorting is an amazing process of sorting your rows by column. Applying this method you can easily sort your rows by column by following these steps.
We have the dataset below and need to sort rows by column.

Utilizing Custom Sorting Method to Sort Rows by Column

Steps:

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

excel sort rows by column

  • A window named Sort will appear.
  • Secondly, go to Options.

  • Eventually, another window will pop up named Sort Options. We want to sort rows by column. So, click on Sort Left to Right.

  • Now a sorting style window appears where we can sort rows. We will sort by Row 4, sort on Cell Values and order is Largest to Smallest. Click OK.

excel sort rows by column

Columns now sort our rows. You can also sort rows from Smallest to largest by using the same steps. Just choose the order Smallest to Largest and your sorting will be done.

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


3. Using Multi-level Sorting Method to Sort Rows by Column in Excel

Using this method, we can sort multiple rows by columns. Follow these steps.

Steps:

  • Firstly, select your dataset, go to Data, and click this icon

Multi-level Sorting Method to Sort Rows by Column

  • Secondly, when the Sort window arrives, click on Option. Then on the new popped-up window, choose Sort Left to Right.

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). Then we customize their style by their values and from Largest to Smallest.
  • Lastly, click OK.

  • Eventually, our rows are sorted by their column value.

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


4. Applying SORT and SORTBY Functions in Excel

The SORT function is pretty useful when you are to sort a wide range of data. In this method, we will use this function to sort the rows by column. We’ll also use the SORTBY function to make the final sorting.

Steps:

  • Firstly, 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

  • Secondly, apply the “SORT” function in the H5
=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. 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

  • Thirdly, press “ENTER”.
  • Eventually, our rows are sorted.

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

excel sort rows by column

  • If we press ENTER we’ll see that the ID Numbers are sorted in an Ascending manner.

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.

➤ In the case of sorting, you need to select the header column cell when you sort your data.

➤ 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.


Conclusion

Four methods of Sorting rows by column in Excel are discussed in this article. Hope this article is useful to you and helps you when you are facing problems. If you have any confusion or suggestions, you are welcome to comment.


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