How to sort multi-level data in Excel
Speaking of Excel, sorting is very important, very, very important. We all want our data to be sorted in multiple ways to get the expected results we are looking for. Sorting based on a single column is straightforward and easy, but what if you want your data to be sorted based on multiple columns? While this may sound impossible, with Excel it's just a piece of cake. You don’t need any coding, you don’t need to be an Excel Guru, you just need this Geek Page article to sort out all your multi-level sorting problems!
In this article, we explain how to sort data in an Excel file based on multiple columns easily with 2 different methods. The first method uses the built-in sort window, while the second method uses the 2 sort icons available in Excel. No matter which method is used, the result is the same. You just have to choose your preferred method! So what are you waiting for? Let’s jump right into the article!
Sample Scenario
In this article, we have created a sample table to explain the multi-level sorting technique. In the table below, I have 3 columns namely Name, Subject and Marks.
I wish to sort the table based on Name and Marks so that Names starts from Sort from minimum to large, Marks sort from large to minimum. So the end result should show the names in ascending order and I should be able to see the highest score that person got first. See the screenshot below to get a better idea of the scenario.
Solution 1: Perform a multi-level sort using the Sort Window
This method uses the Sort window readily available in Excel.
In the next steps, let’s see how to easily sort data based on multiple columns using this simple method.
Step 1: First select the data to be sorted.
Now click on the Data tab on the top ribbon and click on the Sort button.
Step 2: Now in the Sort window, set your first sorting criterion.
Select the first column you wish to sort on. You can select a column name from the Sort by drop-down menu.
Next, set the order in which you want your data to be sorted. Select A through Z from the Order drop-down menu.
After setting the first sorting criterion, click the "Add Level" button at the top.
NOTE : For this method to work, you must sort the columns from smallest to largest. That is, as a first criterion you need to give the column you want to sort from smallest to largest . As a second criterion, you need to give the largest column to the smallest column. Additionally, you can add as many levels as you want.
Step 3: Next, set the second criterion the same way. Select the column from the Then by drop-down menu and set the order from largest to smallest in the Order drop-down menu.
Click the OK button.
Step 4: That’s it. Your data is now sorted on multiple levels. enjoy!
Solution 2: Use the sort icon to perform multi-level sorting
This method is also very simple. In the previous method, you must first sort the smallest to largest columns. This approach is just the opposite. In this approach you have to sort largest to smallest column first. Let's see how to perform multi-level sorting using the sort icon.
Step 1: First, select the columns that need to be sorted from large to small. In the example scenario, I want the Marks column to be sorted from largest to smallest , so I select the Marks column.
Now, click on the Data tab at the top.
Next, under the Data option, click the Z -> A sort icon.
Step 2: When you get the "Sort Warning" dialog box, click the radio button corresponding to the Expand Selection and then click the "Sort" button.
Step 3: If you look at the Excel sheet now, you can see that Marks are from Maximum to Sorted by smallest . Now let's move on to sorting the Name column.
Next select the Name column. Click the Data tab at the top, then click the A -> Zsort icon.
Step 4: In the "Sort Warning" dialog box, select again with Expand SelectionThe radio button corresponding to the option, and then click the "Sort" button.
Step 5: That’s it. Together these two sortings result in a multi-level sorting and your table is now nicely sorted!
We’d love to know which method you chose as your favorite. Our favorite is the first method because it's more straightforward and a one-step solution.
The above is the detailed content of How to sort multi-level data in Excel. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Use an Error Checking Tool One of the quickest ways to find errors with your Excel spreadsheet is to use an error checking tool. If the tool finds any errors, you can correct them and try saving the file again. However, the tool may not find all types of errors. If the error checking tool doesn't find any errors or fixing them doesn't solve the problem, then you need to try one of the other fixes below. To use the error checking tool in Excel: select the Formulas tab. Click the Error Checking tool. When an error is found, information about the cause of the error will appear in the tool. If it's not needed, fix the error or delete the formula causing the problem. In the Error Checking Tool, click Next to view the next error and repeat the process. When not

How to Set GoogleSheets Print Area in Print Preview Google Sheets allows you to print spreadsheets with three different print areas. You can choose to print the entire spreadsheet, including each individual worksheet you create. Alternatively, you can choose to print a single worksheet. Finally, you can only print a portion of the cells you select. This is the smallest print area you can create since you could theoretically select individual cells for printing. The easiest way to set it up is to use the built-in Google Sheets print preview menu. You can view this content using Google Sheets in a web browser on your PC, Mac, or Chromebook. To set up Google

Microsoft Excel is a popular program used for creating worksheets, data entry operations, creating graphs and charts, etc. It helps users organize their data and perform analysis on this data. As can be seen, all versions of the Excel application have memory issues. Many users have reported seeing the error message "Insufficient memory to run Microsoft Excel. Please close other applications and try again." when trying to open Excel on their Windows PC. Once this error is displayed, users will not be able to use MSExcel as the spreadsheet will not open. Some users reported problems opening Excel downloaded from any email client

When you start Microsoft Word or Microsoft Excel, Windows very tediously tries to set up Office 365. At the end of the process, you may receive a Stdole32.tlbExcel error. Since there are many bugs in the Microsoft Office suite, launching any of its products can sometimes be a nightmare. Microsoft Office is a software that is used regularly. Microsoft Office has been available to consumers since 1990. Starting from Office 1.0 version and developing to Office 365, this

What are macros? A macro is a set of instructions that instruct Excel to perform an action or sequence of actions. They save you from performing repetitive tasks in Excel. In its simplest form, you can record a series of actions in Excel and save them as macros. Then, running your macro will perform the same sequence of operations as many times as you need. For example, you may want to insert multiple worksheets into your document. Inserting one at a time is not ideal, but a macro can insert any number of worksheets by repeating the same steps over and over. By using Visu

If you need to record or run macros, insert Visual Basic forms or ActiveX controls, or import/export XML files in MS Excel, you need the Developer tab in Excel for easy access. However, this developer tab does not appear by default, but you can add it to the ribbon by enabling it in Excel options. If you are working with macros and VBA and want to easily access them from the Ribbon, continue reading this article. Steps to enable Developer tab in Excel 1. Launch MS Excel application. Right-click anywhere on one of the top ribbon tabs and when

How to use RANDBETWEEN to generate random numbers in Excel If you want to generate random numbers within a specific range, the RANDBETWEEN function is a quick and easy way to do it. This allows you to generate random integers between any two values of your choice. Generate random numbers in Excel using RANDBETWEEN: Click the cell where you want the first random number to appear. Type =RANDBETWEEN(1,500) replacing "1" with the lowest random number you want to generate and "500" with

How to Find Merged Cells in Excel on Windows Before you can delete merged cells from your data, you need to find them all. It's easy to do this using Excel's Find and Replace tool. Find merged cells in Excel: Highlight the cells where you want to find merged cells. To select all cells, click in an empty space in the upper left corner of the spreadsheet or press Ctrl+A. Click the Home tab. Click the Find and Select icon. Select Find. Click the Options button. At the end of the FindWhat settings, click Format. Under the Alignment tab, click Merge Cells. It should contain a check mark rather than a line. Click OK to confirm the format