Which function would you use to count the number of cells in a range that are not empty?

Which function would you use to count the number of cells in a range that are not empty?

When using Google Sheets, there may be times where you have cells with no data. In these cases, you may want to count the number of cells that are not blank. This is possible by using Google Sheet COUNT functions!

COUNTA is a function for counting cells that are not empty. Sometimes, however, the COUNTA function doesn't catch hidden special characters, so we can use SUMPRODUCT or COUNTIF to resolve this issue.

If you do not know how to use these functions, this tutorial is for you.

COUNTA Method

In Google Sheets, the COUNTA function counts all the number of cells within a range that have values or a text string in it. It ignores cells that are empty while completing the count. 

As an example, here is data that has blank cells within a range:

Which function would you use to count the number of cells in a range that are not empty?

To count the number of cells that are not blank, just follow these steps.

  1. Select a blank cell and type the =COUNTA function including the range of cells that you want to count. For example, we used =COUNTA(A2:A11).
  2. Just hit enter, and the COUNTA function will automatically count the cells that are not blank.
  3. You now have the total number of cells that have values in it!

Which function would you use to count the number of cells in a range that are not empty?

SUMPRODUCT Method

COUNTA function is very useful in counting cells that are blank or have no data in it. However, there may be times that COUNTA counts cells that seem empty. This is because, technically, those cells are not blank but just have a white space appearing on it. It happens, for instance, when you use conditional formatting that makes it appear as blank or sneaking a function =”” in it!

Which function would you use to count the number of cells in a range that are not empty?

To avoid this from happening, use SUMPRODUCT instead by following these steps:

  1. Click on an empty cell and input the function =SUMPRODUCT(--(LEN(range)>0)) to count the cells that do not appear empty. In the process, the LEN function returns a value that is greater than zero while counting the number of characters that appear in the sheet.
  2. Just click Enter and the number of the cells that have values in it will automatically appear.

Which function would you use to count the number of cells in a range that are not empty?

COUNTIF Method

If you have read the previous tutorials, Google Sheets hide some special characters from view because of their special functions: this include the apostrophe, that it uses to indicate that the number characters should be interpreted as a string (we used this to input phone numbers to Google Sheets). To solve this, we will learn how to use COUNTIF to count cells that are not blank and do not have special characters hidden.

As an example, let us look at this table:

Which function would you use to count the number of cells in a range that are not empty?

How many cells have entries in the table? There are nine (9) entries in that table. However, if you apply COUNTA function to count the entries, the result would be thirteen (13):

Which function would you use to count the number of cells in a range that are not empty?

The reason is that there are stray apostrophes and spaces in that table, and COUNTA counted them in. To exclude them from the count, we apply the COUNTIF function with a special attribute:

=COUNTIF(B3:E7,">0"&"*")

What happened? The “>0”&”*” serves as the condition to filter out cells that contain hidden characters, thus only the ones with letters and numbers are counted.

Want to know more about Google Sheets?

Do you have more questions in mind about using Google Sheet? Check out our other spreadsheet resources and learn more functions and tricks that you can use when working!

How do you count the number of cells that are not blank?

Use the COUNTA function to count only cells in a range that contain values. When you count cells, sometimes you want to ignore any blank cells because only cells with values are meaningful to you. For example, you want to count the total number of salespeople who made a sale (column D).

Which function would you use to count the number of cells in a range that are not empty a Counta B count c counter D Countb?

The COUNTA function in Excel counts the number of cells in a range that are not empty.

Which function is used to counts the number of cells in a range?

The COUNT function counts the number of cells that contain numbers, and counts numbers within the list of arguments. Use the COUNT function to get the number of entries in a number field that is in a range or array of numbers.

Which function is used if you want to count the number of cells within a range that meets the given condition?

Use COUNTIF, one of the statistical functions, to count the number of cells that meet a criterion; for example, to count the number of times a particular city appears in a customer list.