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.
Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!
The DSUM function is very handy when you need to calculate a sum based on data that matches criteria you specify. If you ...Discover More
Excel allows you to easily develop formulas that pull values from worksheets and workbooks other than the one in which ...Discover More
If you need to insert into a cell the name of the workbook in which a worksheet is contained, you can use the CELL ...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.