How to Sort by Column in Excel and Keep Rows Together (4 Easy Ways)

Get FREE Advanced Excel Exercises with Solutions!

In this article, we will show how to sort by column in Excel while keeping rows together. Sorting is the best way to make the dataset more convenient and acceptable. This makes our work with datasets in various ways. MS Excel provides different ways to sort data for different purposes.

Firstly, we will use the Sort command. Secondly, we will go for the Advanced Sort command. Thirdly, we will sort the columns alphabetically. Then, we will sort multiple columns using the Sort command. Finally, we will use the SORT function to sort multiple columns alphabetically while keeping the rows together.


1. Using Excel Sort Command to Sort by Column and Keep Rows Together

This method will sort a dataset by column and keep the rows together. In the process, we will use the Sort command. This command will sort the column according to our needs.

Steps:

  • Firstly, select the cells in the range D5:D10.
  • Secondly, go to the Data tab.
  • Thirdly, from the Sort & Filter group, choose Sort.
  • As a result, a prompt will be on the screen.

selecting sort command to sort by column to keep rows together in excel

  • From the prompt, first, select Expand the selection.
  • Then, click on Sort.

  • Consequently, the Sort dialogue box will be on the screen.
  • From the box, select the order of your sorting.
  • In this case, we will select Smallest to Largest.
  • Then, click OK.

selecting order of sorting to sort by column to keep rows together in excel

  • Consequently, the column will be sorted.

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


2. Sorting Column Alphabetically by Columns and Keeping Rows Together in Excel

In this example, we will sort a column alphabetically while keeping the rows together. We will use the Advanced Sort command. This operation will arrange the names according to the alphabet.

Steps:

  • To begin with, select the cells in the range C5:C10.
  • Then, go to the Data tab.
  • Finally, from the Sort & Filter group, select Sort A to Z.
  • Consequently, a prompt will appear on the screen.

selecting sort a to z to sort by column to keep rows together in excel

  • From the prompt, select Expand the selection.
  • Then, select Sort.

  • As a result, the column will be sorted alphabetically.

Read More: How to Sort Columns in Excel Without Mixing Data


3. Sorting by Multiple Columns in Excel but Keep Rows Together

In this instance, we will sort the dataset by multiple columns. The sorting will be done, firstly by a particular column and then by another column. This will allow users to prioritize their sorting options.

Steps:

  • To start with, choose the dataset.
  • Then, select the Sort command from the Data tab.
  • As a result, a prompt will appear on the screen.

  • In the prompt, first, choose the Add Level option.
  • After that, select the Name column in the Sort by option.
  • Then, choose the Region column in the Then by option.
  • Finally, click OK.

selecting multiple columns to sort by column to keep rows together in excel

  • As a result, the data set will be sorted by the two columns.

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


4. Sorting Multiple Column Alphabetically by Column with Excel SORT Function

The SORT function sorts an array of data, and the users can specify how many columns to sort. In this example, we will sort all four columns using the SORT function.

Steps:

  • Firstly, select the B13 cell and type,
=SORT(B5:E10,4)
  • Then, hit Enter.
  • As a result, the dataset will be sorted accordingly.

using sort function to sort by column to keep rows together in excel

Read More: Excel Sort by Column Without Header


Download the Practice Workbook


Conclusion

In this article, we have talked about how to sort by column in Excel while keeping rows together. These are some ways to sort by column while keeping rows together in Excel. I have shown all the methods with their respective examples but there can be many other iterations. I have also discussed the fundamentals of the used functions. If you have any other way of achieving this, then please feel free to share it with us.


Further Readings


<< Go Back to Sort in Excel | Learn Excel

What is ExcelDemy?

ExcelDemy - Learn Excel & Get Excel Solutions Center provides online Excel training , Excel consultancy services , free Excel tutorials, free support , and free Excel Templates for Excel professionals and businesses. Feel free to contact us with your Excel problems.
Md. Abdullah Al Murad
Md. Abdullah Al Murad

Md. Abdullah Al Murad is a computer engineer who loves exploring Excel and VBA programming. Programming, to him, is a time-saving tool for efficiently managing data, files, and internet tasks. He is proficient in C, C++, Python, JavaScript, HTML, SQL, MySQL, PostgreSQL, Microsoft Office, and VBA and goes beyond the basics. He holds a B.Sc. in Computer Science and Engineering from American International University-Bangladesh. He has transitioned into the role of a content developer. Beyond his work, find... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo