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: Counting with Subtotals.
by Allen Wyatt
(last updated January 2, 2018)
Suppose that you have two adjacent columns of data. In the first column you have a list of names and in the second column a list of states. If you want to find out how many people live in each state, you can use the subtotaling features of Excel. To use this feature to answer your query, follow these steps:
Figure 1. The Name/State Fields of the Subtotal dialog box.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (8035) 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: Counting with Subtotals.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
You can insert subtotals and totals in your worksheets by using either a formula or specialized tools. This tip explains ...Discover More
Do you have a worksheet from which you need to print only portions of the data available? There are two ways you can ...Discover More
Don't want your form controls to print out with your worksheet? Here's how to make sure that Excel excludes them from ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
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.