Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Previous article   Next article back to categoryExcel articles

How To Use The Subtotal Function In Excel

Mon 3rd January 2011

One of the most useful Excel function is subtotal. Learn how to use it and discover some really useful features by reading this article.
You may be surprised or even amazed at how useful the subtotal function in Excel can be. This article reveals how versatile this Excel function is and describes three really useful features. When in use, the function formula looks something like this =SUBTOTAL(9,D1:D4) showing you that within the brackets there's a code number, followed by a range of cells.

The first really useful feature is that this code number is used to tell Excel what kind of function to apply to the specified range of cells. For example a 9 means sum, so in this example the result would be a sum all the cells in the range D1 to D4. You can use the code numbers 1 to 11 to apply different numerical functions to the range of cells. The most frequently used code numbers are 1 for "AVERAGE", 2 for "COUNT" and 9 for "SUM".

To see the full code list, first add the subtotal function to a cell and use, for example, the 9 code to sum some cells. Ensure the cell containing the subtotal function is still selected and click on the fx symbol to the immediate left of the editing panel above the spreadsheet. In the Functions Arguments panel the subtotal function should be showing. Click on the blue link "Help on this function" in the lower left of the panel and you'll see the full list of codes and functions available. This code number lets you apply a wide range of different numerical functions just by changing this number.

The second really useful feature is that the subtotal function normally only works on visible cells. This means that, for example, if you use an Autofilter and select only certain records in a table, then any subtotal function which calculates a value from cells in the table only calculates on the currently displayed cells. To illustrate this, suppose you have a table of data consisting of several columns, with the last column containing numbers. Add a SUM function and a SUBTOTAL function in separate cells under the last column, with both functions adding the cells in this last column. Of course both should show the same value.

Now add an autofilter to the table, and apply a filter setting. Once done you should find that the SUM function still adds all the original cells, but the subtotal function now adds only the visible cells. So subtotal can be used to analyse data in situations such as filtering where some cells may be hidden.

The third really useful feature is that the subtotal function ignores any other subtotal functions within the specified range of cells. Have you ever needed to add lots of cells in a single column, and then noticed that there are several sum functions already in the column? In this situation adding a sum of all the cells adds all the cell values and all the other sum functions as well. The subtotal function allows for this situation. If you subtotal a range of cells containing existing subtotals, you will be pleasantly surprised to discover that the internal subtotals are ignored, so the function accurately sums all the cell values. You can see this at work if you apply the subtotal command to an subtotal functions.

In conclusion the versatile subtotal function has three key benefits. Firstly the code number from 1 to 11 within the function lets you choose from a wide range of numerical functions. Secondly the function only acts on visible cells, making it ideal to analyse filtered data. Thirdly the function ignores other subtotals within the specified range of cells, making it the perfect tool to create several subtotals and an overall total within a single column of numbers.

If you're interested in finding out more about Excel functions a really good way would be to attend a training course and really boost your Excel skills.

Author is a freelance copywriter. For more information on excel training london, please visit https://www.stl-training.co.uk

Original article appears here:
https://www.stl-training.co.uk/article-1346-how-use-subtotal-function-in-excel.html

Back to article list

Publication Guidelines

  • You have permission to publish this article for free providing the "About the Author" box is included in its entirety.
  • Do not post/reprint this article in any site or publication that contains hate, violence, porn, warez, or supports illegal activity.
  • Do not use this article in violation of the US CAN-SPAM Act. If sent by email, this article must be delivered to opt-in subscribers only.
  • If you publish this article in a format that supports linking, please ensure that all URLs and email addresses are active links, without the rel='nofollow' tag.
  • Software Training London Ltd. owns this article. Please respect the author's copyright and above publication guidelines.
  • If you do not agree to these terms, please do not use this article.

Excel courses in London and UK wide.

» Next available dates

 

Training courses

 

London's widest choice in
dates, venues, and prices

Public Schedule:

Buy now / Live dates

On-site / Closed company:

Get quote

Testimonials

More testimonials

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.11 secs.