Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. 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 Non-Blank Cells.
by Allen Wyatt
(last updated June 13, 2015)
You may already know that you can use the COUNTBLANK function to return the number of blank cells in a range. What if you want to count the number of non-blank cells in the same range? One way is to use the COUNTA function, as shown here:
The only problem with this formula is that it doesn't return the complementary value to what COUNTBLANK returns. In other words, the result of COUNTA added to the result of COUNTBLANK doesn't equal the total number of cells in the original range. The reason for this is that both COUNTBLANK and COUNTA treat formulas different. COUNTBLANK includes, as blank, formulas that return a blank value. COUNTA does not consider such cells blank (even though a blank is returned), so it includes them in its count.
If you consider non-blank cells to be those that are not returned by COUNTBLANK, then you will need to use a longer formula:
This formula subtracts the COUNTBLANK result from the total number of cells in the same range.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (11100) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Counting Non-Blank Cells.
Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!
At the heart of working with Excel is the process of creating formulas that calculate results based on information within a ...Discover More
Adding row numbers to a column of your worksheet is easy; you just need to use a formula to do it. Here's a quick look at a ...Discover More
Teachers often grade on what is affectionately referred to as "the curve." The problem is, it can be a bit difficult to ...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.