How to Sort Subtotals in Excel
Last Updated :
17 May, 2024
Sorting and adding subtotals is one of the features of Excel which is important for organizing and summarizing data in a structured manner. In this article, you will see the overview of Sorting and Adding Subtotals to Excel and then will discuss all the steps to perform, allowing you to take control of your datasets and derive valuable insights.
What are Subtotals in Excel
In Excel, the "Subtotal" is a function that calculates subtotals for a range of data based on a specified column. It's commonly used in large datasets to summarize data at different levels, such as groups or categories. The SUBTOTAL function can perform various aggregate functions like SUM, AVERAGE, COUNT, MAX, MIN, etc., and it automatically updates when the data changes. This function is helpful for creating organized reports or analyses, especially when dealing with extensive datasets.
How to Sort Subtotals in Excel
To arrange data based on subtotals, begin by inserting subtotals into the dataset. After you've added subtotals, you can sort the data while preserving its structure and ensuring that related data remains grouped together.
For Example, You've the Following data:
.png)
To group students and calculate subtotals for each student in Column A, allowing you to sort their marks while retaining all the individual details, make sure your data is sorted based on the column you intend to group (in this case, Column A). Here's how to do it:
Step 1: Select the Data
Step 2: Go to the Data tab in the Ribbon
Step 3: Click on Subtotal to access the Subtotal window
.png)
Step 4: Fill the details
In the Subtotal window, select "Student" as the criterion in the "At each change in" drop-down menu.
Check the box next to "Marks" under the "Add subtotal to" section.
.png)
Step 5: Click OK to Apply the Subtotals
Step 6: Preview the Result
.png)
Following these steps, you'll see subtotals generated for each student in Column A. This allows you to sort the marks of each student while preserving the detailed data for each individual.
How to Add Subtotals in Excel
Follow the below steps to Add subtotals in Excel:
Step 1: Make sure your data in Sorted
Before adding subtotals, make sure your data is sorted correctly according to your need. Subtotals are typically added to a sorted dataset for better organization.
Step 2: Access the subtotal Dialog Box
Select the "data" tab on the Excel Ribbon and click on the "Subtotal" button in the "Outline" group. Now you can select the subtotal setting according to your need.
Step 3: Set the Subtotal options
In the Subtotal dialog box, first, choose the column you want to use for subtotals from the "At each change in" drop-down list. Now select the function you want to apply from the "User Function" drop-down list.
Step 4: Choose the column for Subtotal
In the "Add Subtotal to " Section, check the boxes of the columns for which you want subtotals to be calculated.
Step 5: Select the Summary Row option
Check the "Replace current subtotals" box, This will add a row with the grand total at the bottom of your dataset.
Step 6: Apply the subtotals
After selecting the options, click "ok" in the Subtotal dialog box.
Step 7: Expand and collapse Subtotals
Also Read
Similar Reads
How to perform T-tests in MS Excel?
The T-Test function in Excel calculates the chance of a significant difference between two data sets, regardless of whether one or both are from the same population and have the same mean T-Test, which also includes whether the data sets we're utilizing for computation are a one-tail or two-tail dis
4 min read
How to Use Solver in Excel?
A solver is a mathematical tool present in MS-Excel that is used to perform calculations by working under some constraints/conditions and then calculates the solution for the problem. It works on the objective cell by changing the variable cells any by using sum constraints. Solver is present in MS-
3 min read
How to Sort by Number in Excel?
Excel is the world where you can organise your data. Organising data is a very big task especially when you are doing it on a large scale. In Excel, one can have around 17 million cells in one worksheet. So at this point, arranging the data in a systematic order is very important. If you are curious
2 min read
How to Sort by Date in Excel?
Excel provides various types of sorting formats e.g. âsort A to Zâ, âSort Z to Aâ, âSort by colorâ and âSort by dateâ etc. Sorting in Excel is nothing but arranging data into some meaningful order to make it easier to understand, analyze, or visualize. Here, we will be discussing how to sort by Date
6 min read
How to Create Relational Tables in Excel?
Excel directly doesn't provide us ready to use a database, but we can create one using relationships between various tables. This type of relationship helps us identify the interconnections between the table and helps us whenever a large number of datasets are connected in multiple worksheets. We ca
4 min read
How to Hide Zero Values in Excel
Microsoft Excel enables us to format, organize and calculate data in a spreadsheet. It's a great tool for preparing datasets and it makes those datasets easier for users and analysts to analyze the data. Sometimes these datasets contain zero values that are not required to be seen. Excel provides an
6 min read
How to Flatten Data in Excel Pivot Table?
Flattening a pivot table in Excel can make data analysis and extraction much easier. In order to make the format more usable, it's possible to "flatten" the pivot table in Excel. To do this, click anyplace on the turn table to actuate the PivotTable Tools menu. Click Design, then Report Layout, and
7 min read
How to Rotate Pie Charts in Excel?
A Pie Chart is a circular statistical graphic, which is divided into slices to illustrate numerical proportion.In this article, we'll see how we can create and rotate pie charts. How to make Pie Charts in Excel ? Follow the below steps to create a pie chart in Excel: Step 1: Formatting data for pie
2 min read
How to Sort Data by Color in Excel?
Sorting Data By Color allows us to segregate the data cells of a specific color. There can be many ways to sort by color like sorting by Cell color, sorting by Font color, etc. We can also add multiple levels in sorting data by color. Sorting by Color makes analysis very easy and time-saving. Sort b
3 min read
How to Hide Zero Values in Pivot Table in Excel?
One of Microsoft Excel's most important features is the pivot table. You might be aware of this if you have worked with it. It provides us with a thorough view and insight into the dataset. You can do a lot with it. The pivot table might include zero values. In this lesson, you will learn how to hid
5 min read