Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 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 Non-Blank Cells.
Written by Allen Wyatt (last updated June 13, 2020)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365
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:
=COUNTA(B1:B13)
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 differently. 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:
=(ROWS(B1:B13)*COLUMNS(B1:B13))-COUNTBLANK(B1:B13)
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, 2013, 2016, 2019, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Counting Non-Blank Cells.
Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!
Excel provides several different ways that you can split apart the contents of a cell. One way it doesn't provide is to ...
Discover MoreDo you need to total all the cells that are a particular color, such as yellow? This tip looks at three different ways ...
Discover MoreWhen you enter references to cells in a worksheet, using the Fill Handle to propagate the formulas to other cells can be ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
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.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments