How to Make Subtotal and Grand Total in Excel (4 Methods)

Consider the dataset as shown in the following screenshot. Here, the sales report contains Product Items, States, Price, Quantity, and Sales. We’ll calculate the subtotals and grand total for the Sales column.

Dataset


Method 1 – Using the SUBTOTAL Function to Make a Subtotal and Grand Total

Let’s find the subtotals based on each group of products (i.e. Product A, Product B, and Product C), and we’ve shifted the dataset to divide it based on the groups. We’ll also determine the grand total (in the F17 cell) for all groups of products.

Preparation of Dataset

Steps:

  • Insert the SUBTOTAL function.
  • While entering the formula, you’ll see some groups of functions. From there, you need to select 9 as you’re going to compute the sum of the Sales.
  • Select the cells (F5:F7) of Product A as the reference input.
  • The formula for the F8 cell will look like the following:

=SUBTOTAL(9,F5:F7)

Here, the SUBTOTAL function returns the sum values of the Sales in the case of Product A.

Using the Excel Function

  • The following image displays the formula from the sample dataset.

Using the Excel Function

  • Press Enter and copy-paste the formula (with Ctrl + C to copy and Ctrl + V to paste) to cells F12 and F16.

Using the Excel Function

  • Insert the following formula in F17:

=SUBTOTAL(9,F5:F16)

The function automatically excludes the computed subtotal of Products A, B, and C.

How to Make Subtotal and Grand Total in Excel Using the SUBTOTAL Function

  • The output will be as follows.

How to Make Subtotal and Grand Total in Excel Using the SUBTOTAL Function


Method 2 – Using the SUM Function

  • Here’s the formula for computing subtotal for Product A.

=SUM(F5:F7)

  • Copy and paste the formula for Product B and Product C.
  • The formula for calculating the grand total is:

=SUM(F6:F16)/2

The SUM function returns all the sum values. When I divided it by 2, it would return the actual grand total as subtotal values are available there.

How to Make Subtotal and Grand Total in Excel Using SUM Function

Read More: How to Insert Subtotals in Excel


Method 3 – Utilizing the Subtotal Feature to Make a Subtotal and Grand Total

  • Select the dataset and keep the cursor over any cell within the dataset.
  • Go to the Data tab and the Data Tools ribbon, then click on the drop-down list for Outline and choose the Subtotal feature.

How to Make Subtotal and Grand Total in Excel Using the Subtotal Feature

  • You’ll see a dialog box named Subtotal. Pick the Product Items from the drop-down list of the At each change in: option.
  • Put the Sum function in the function box and check Sales (from the options of Add subtotal to).
  • Check the box before Replace current subtotals and Summary below data options (these should be checked by default).

Using the Subtotal Feature

  • You’ll get the subtotal and grand total together after pressing OK.

How to Make Subtotal and Grand Total in Excel Using the Subtotal Feature

If you want to display only the Grand Total, just click over the 1 (located on the upper-left side as depicted in the following image).

Using the Subtotal Feature

Similarly, if you want only to represent the subtotal and grand total instead of the entire dataset, click over 2.

How to Make Subtotal and Grand Total in Excel Using the Subtotal Feature

Read More: How to Use SUBTOTAL in Excel with Filters


Method 4 – Use a Pivot Table to Get a Subtotal and Grand Total

  • Select the entire dataset and pick the From Table/Range option by clicking over the drop-down list of the Pivot Table in the Insert tab.

Creating Pivot Table

  • Press OK (keep the default options).

Creating Pivot Table

  • Drag the Fields to their relative areas. For the example, the Product Items go to Rows area and Sales to Values area.

Creating Pivot Table

  • You’ll get the following output where the C5, C6, and C7 cells show the subtotal of Product A, B, and C respectively. The C8 cell displays the Grand Total.

How to Make Subtotal and Grand Total in Excel Creating Pivot Table


Download the Practice Workbook


Related Articles

<< Go Back To Subtotal in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Md. Abdul Kader
Md. Abdul Kader

MD. ABDUL KADER is an engineer with a talent for Excel and a passion for VBA programming. To him, programming is like a time-saving wizard, making data manipulation, file handling, and internet interactions a breeze. His skill set extends to SWM, GIS, RS, and SPSS. He holds a B.Sc in Urban & Regional Planning from Chittagong University of Engineering and Technology and has shifted to become a content developer. In this role, he crafts technical content centred around... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo