Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Using Subtotals and Totals.

Using Subtotals and Totals

Written by Allen Wyatt (last updated January 8, 2022)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021


3

There are many times you may need to have both subtotals and totals in the same column of data. The easiest solution would be to put subtotals and totals in different columns (like accountants often do), but this is not always practical for the data at hand. In these instances, there are three different approaches you can use.

The first approach is to place your various subtotals, as desired. Then, when it comes time to place your totals, simply use a modified SUM formula. For instance, if you want to get a total for the range F10:F32, and there are subtotals interspersed in the column, you would use this formula for your total:

=SUM(F10:F32)/2

This works because the addition of the subtotals simply doubles the real value of the column. The second way is to use the familiar AutoSum feature of Excel, accessible in the Editing group on the Home tab of the ribbon. Insert your subtotals as normal in the column. When you are ready to add your total, select all the cells you want to total, as well as the cell where your total will appear. So if you want a total for the range B3:B20 (which includes some subtotals), and you want the total to appear in B21, select cells B3 through B21. Then click on the AutoSum tool. The total inserted by Excel in cell B21 is the sum of all the subtotals in the column.

If you are using a well-defined data table (headings, multiple columns, etc.), then you may also want to use the built-in subtotals feature of Excel. This works particularly well if you need subtotals based on a change in a particular column value. For instance, you may have a table that lists products in one column, quantities in another, and values in another. You can insert subtotals and totals for this table by following these steps:

  1. Sort the table by the values in the Products column.
  2. Display the Data tab of the ribbon.
  3. Click the Subtotal tool in the Outline group. Excel displays the Subtotal dialog box. (See Figure 1.)
  4. Figure 1. The Subtotal dialog box.

  5. Make sure the At Each Change In drop-down list is set to Products. (This indicates where Excel will insert subtotals.)
  6. The Use Function drop-down list should be set to Sum.
  7. Using the list in the Add Subtotal To box, choose the columns to which subtotals should be added.
  8. Make sure the Summary Below Data check box is selected. (This inserts the total you need.)
  9. Click on OK.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (11747) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. You can find a version of this tip for the older menu interface of Excel here: Using Subtotals and Totals.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Adding Caption Labels

When using the captioning capabilities of Word, you aren't limited to the three default caption labels provided in the ...

Discover More

Find and Replace in Text Boxes

Find and Replace can work great, but not necessarily for text within text boxes. This tip discusses all the ins and outs ...

Discover More

Technique for Adding a Text Box to an Envelope

Text boxes can be a great design feature to use in laying out a document. You may want to add one to an envelope, ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Finding the Analysis ToolPak Add-In

The Analysis ToolPak is used to add some very handy capabilities to Excel. If you don't have it installed, and you can't ...

Discover More

Creating Add-Ins

Want to create your own add-in? Excel makes it easy to do. Here are all the steps you need.

Discover More

Fixed-Width Settings when Converting Text to Columns

The Convert Text to Columns capabilities of Excel are very helpful when pulling apart information. When working with ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 8 + 7?

2022-01-08 14:29:39

Waldo Pita

Another thoughts - The "Subtotal and Total" seminar utilizes "AutoSum" and "SubTotal". It would greatly improve your tips if you took 2 seconds and advised the reader where to find these functions within Excel. If I utilized either of these functions & knew where they were within Excel - Ya think I would read your TIP?


2022-01-08 14:15:45

Waldo Pita

Problem(s) with your emails - Great description of functions / features but NO EXAMPLE(S) that show the function you are describing. Readers would obtain a greater understanding of the function if we can see it working. Assume you asked someone the tax effect of XYZ transaction and they sent you the applicable code section. Would you rather have that as will as the actual tax liability & how it was calculated?????? Reading your email Tips is time consuming since you leave it to the reader to figure out the function You are at 10,000 as they now stand


2022-01-08 13:56:48

Waldo Pita

Autosum Function described within your "Subtotals and Totals" seminar DOES NOT work as described -->When you are ready to add your total, select all the cells you want to total, as well as the cell where your total will appear. So if you want a total for the range B3:B20 (which includes some subtotals), and you want the total to appear in B21, select cells B3 through B21. Then click on the AutoSum tool. The total inserted by Excel in cell B21 is the sum of all the subtotals in the column." The AutoSum will add the values from the LAST Sum function down. IT WILL NOT INCLUDE PRIOR VALUES OR PRIOR SUB-TOTALS.


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.