Written by Allen Wyatt (last updated May 19, 2022)
This tip applies to Excel 97, 2000, 2002, and 2003
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 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:
=(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 (2996) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Counting Non-Blank Cells.
Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!
If you have a series of values in a range of cells, you may wonder how many of those values are even and how many are ...
Discover MoreWant to create a sequential pattern using formulas? It's easy to do if you take a look at how your data repeats. This tip ...
Discover MoreWhen analyzing your numeric data, you may need to figure out the largest and smallest numbers in a set of values. If you ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2018-12-26 15:10:35
MARLENE CASE
I don't understand. I used your formula, but I get the same answer for both formulas; 69
=COUNTA(J2:J98)
=(ROWS(J2:J98)*COLUMNS(J2:J98))-COUNTBLANK(J2:J98)
I am trying to figure out why Excel is not counting the cells that have an X in them correctly. When I counted by hand there are 67 cells with x in them and yet Excel insists upon telling me it is 69.
I thought by countblank I could figure it out until I read your hint. Now I am even more confused. I have never had this problem with Excel before I started using Microsoft 365. Very frustrating.
Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments