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

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, and Excel in Office 365. 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

Converting Imported Information to Numeric Values

If the information you import into Excel is treated as text by the program, you may want to convert it to numeric values. ...

Discover More

Generating Random Strings of Characters

If you need to generate a random sequence of characters, of a fixed length, then you'll appreciate the discussion in this ...

Discover More

Making Sure Num Lock is On

The Num Lock key controls how your numeric keypad behaves and, possibly, a few other behaviors. Here's how to adjust ...

Discover More

Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!

##### More ExcelTips (ribbon)

Resolving Revisions

You've reviewed the changes that were made to your workbook using the Highlight Changes tool. Now you need to remove the ...

Discover More

Tracing Precedents and Dependents Clears Undo Stack

Excel normally allows you to undo actions you take so that you can "step back" through what you may have been doing. ...

Discover More

Once you've created your custom add-in, you need to know how you or other people can use it. Here are the simple steps to ...

Discover More
##### Subscribe

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

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 3 + 8?

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.