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: Counting with Formulas.
by Allen Wyatt
(last updated April 16, 2016)
If you are working with a data table that has a limited number of categories by which you want a count, you can use the COUNTIF worksheet function to do your work. For instance, you may have a data table that has two columns. Column A could be names of customers and Column B could be names of sales representatives. There are only half a dozen sales representatives, but scores of customers.
In Column E, list the names of your sales reps, one rep per row. (If you have only a half dozen sales reps, you should have only six rows filled out.) Begin in Row 2, since E1 will probably be used for the column name, such as "Sales Rep." The sales rep names should be spelled exactly as they appear in the data table.
In Column F, beside the first sales rep, enter the following formula:
Make sure you replace $A$2:$B$200 with the actual range of your original data table. (You could use a named range, if desired.)
Copy this formula (cell F2) into the other five rows of Column F (cells F3:F7), right beside each sales rep's name.
That's it! The information in Column F represents the number of customers for each sales rep.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (11987) 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: Counting with Formulas.
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!
Want to return more than a value when doing a lookup? Here are a couple of ways to do it by adding an IF clause to your ...Discover More
Excel allows you to easily convert values from decimal to other numbering systems, such as hexadecimal. This tip explains ...Discover More
Got a ton of names from which you need to select a few random names? There are several ways you can extract what you ...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.