Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, and 2016. 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

by Allen Wyatt
(last updated December 12, 2015)

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, and 2016. 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

Printout Doesn't Match Preview

Print Preview is used to see how a printed document will really look. What if what you see on-screen doesn't match what you ...

Discover More

Grabbing the Second-to-Last Value in a Column

Need to get at the next-to-last value in a column, regardless of how many cells are used within that column? This tip ...

Discover More

Removing Personal Information

As you create and work on your workbooks, Excel can include sensitive personal information with the data. If you want to get ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More ExcelTips (ribbon)

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

Excel Refuses to Put Page Breaks between Subtotal Groups

Page breaks not appearing where you expect them in your subtotaled data? It could be because of a setting you made in your ...

Discover More

Using Check Boxes

Check boxes, just like those used in Windows dialog boxes, can be a great addition to a worksheet. Here's how to add them and ...

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}] 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 6 + 0?

2017-02-24 09:01:27

skiing in Petoskey

This is skiing in Petoskey
Thanks for the comments. I've been able to generate a listing of all the subtotals. That by clicking the (2) in upper left of SS. But the listing only gives the subtotals. So you don't know what the subtotal is for. I found that on the full SS (3) in upper left. When the subtotals are entered excel adds a blank line for the subtotal. So when it lists the subtotals there is no information. I'd like to have the category inserted there. I can do that by entering it on the main SS but with 60 categories and 2000 rows that is not good. Especially since I'll be updating the SS frequently.
Is there a way to auto insert the category?
Could I create a MACRO that would recognize the blank cell and then insert the category info into the cell with the subtotal?
Thanks I enjoy excel and its challenges.


2017-02-23 05:22:37

Paul Burton

Answer 1 for Skiing in Petoskey's question 2017-02-22 20:36:13 i would have a control sheet with the titles of the totals and other information you require and then for the amount click = and pick out the subtotal or items you want to add from the different sheets or locations of the relevant cells and have a + sign between each cell you want to add into the total.


2017-02-22 20:36:13

Skiing in Petoskey

I have about 2000 checks that I've entered from 10 years. I have columns of date, Name, categories and amount. I want to show subtotals of categories such as utilities, etc. Then separate the categories by month and year. I want a way to transfer the subtotals so they can be combined and totaled. This is primarily for budgeting. So we want to see the costs of the various categories by month and year.


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.