Bottom Line: Learn how the SUBTOTAL function is used in the formulas in the Total Row of Excel Tables.
Skill Level: Beginner
Download the Excel File
You can follow along with the video using the same workbook I do, if you like. Here is the Excel file:
Using the SUBTOTAL Function in Excel
The SUBTOTAL function is a versatile function that can be used in many different scenarios in Excel.
For this post, I explain how the SUBTOTAL function is used in the Total Row of Excel Tables. The total row automatically creates the formula for us, but it's important to understand how the SUBTOTAL function works.
Turning the Total Row on and off for an Excel Table is easy. Just click anywhere inside the table, go to the Design tab, and check or uncheck the box for Total Row.
In the next post I explain a different use for SUBTOTAL in more of an outline or report style format. Sometimes you will see subtotal rows interspersed throughout a report or a data set, and then a Grand Total row at the very bottom. I will be discussing how the SUBTOTAL function and the Subtotal Feature of Excel help with that in the next post.
The SUBTOTAL Function Explained
This SUBTOTAL function will only display the totals for any visible cells. If you filter out or manually hide rows, the values from those cells will automatically be removed from the sum that the SUBTOTAL function creates.
The SUBTOTAL Function has two arguments.
- The first argument identifies what type of calculation you are looking for, such as an average, a sum, a count, a standard deviation, etc. Each of these types of calculation is assigned a number by Excel. 1 through 11 calculate based on all of the cells in a given data range, while 101 through 111 calculate only the cells that are visible in a data range. The default for the Total Row is 109, which is the designation for a sum of the visible cells.
- The second argument is the reference. This is simply the data range that you want the subtotal to calculate from. You can include more than one reference if you want the subtotal to include data from non-contiguous ranges.
Quickly Changing the Calculation Type
Next to the Subtotal calculation is a little arrow that expands to a drop-down box. This menu allows you to select a different type of calculation.
Instead of clicking the down arrow, you can use the keyboard shortcut Alt + ↓.
Another way to create a SUBTOTAL function is by clicking on the AutoSum button on the Home tab.
Or you can use the keyboard shortcut Alt + =.
This calculates the same as the default for a Total Row (109), which is a sum of all visible cells in the referenced range. The only quirk about using AutoSum is that it doesn't format the result using the same formatting as the reference range.
Check out these related videos and tutorials for more information about the SUBTOTAL function or Excel Tables.
I hope this post has been valuable in helping you understand how the Total Row works in Excel Tables. I welcome any feedback or questions in the comments below. See you in the next post!