Search
Close this search box.

Home

Excel Countif Function to Count Non Blank Cells – Step by Step Guide

Microsoft Excel is one of the most vital tools used everywhere for financial, administrative, and diverse data analysis contexts. As you may know, Microsoft Excel is quite popular for its most helpful feature which is Formulas. By using these Short Formulas Users can perform any time-consuming task and manual work that requires a lot of hours in a few seconds. The only requirement is you need to know the basic syntax of the formula and how to use it.

Similarly, This Article is all about using one of the most common and super helpful Functions: the COUNTIF function. In Talk with the COUNTIF Function, it has the ability to count the cells of Excel that are not blank or have no values. So let’s know more deeply about this function, What more we can do with this feature, What the capabilities of these features and what errors you may face while implementing these Excel features.

Also Check:

What is Excel Countif Function?

This is one of the built-in functions provided by Microsoft Excel to ease the work of the user. Basically, the COUNTIF function has the ability to count the number of cells that match the condition passed in the COUNTIF block. Not only does it count cells that are true for specific conditions but also you can limit the range for that condition. It means you can apply the limit on cells and COUNTIF will only work in the range. For instance, you can count the number of cells in an Excel sheet that have a greater value or lesser value than the specified value in the COUNTIF condition.

In this article, we focus on how to determine the count of cells that are not empty or contain values using the COUNTIF function.

Syntax of Countif Function to Count Non-Blank Cells

“=COUNTIF(range,”<>”&””) or  COUNTIF(range,”<>”)”

As we can see this technical COUNTIF condition is made of Two parameters, the First Range and the Second parameter it accepts which is Criteria.

  • Range: The Range decides the Starting and ending point of Cells under which you want to perform this Function. In Simpler words, The COUNTIF function will work for a specific cell range.
  • Criteria or “<>”: The second parameter we are using is “<>” which is the logical operator used for checking the “not equal to” condition. We are using this not equal to an operator to get count of all non blank cells.

Note: If you are using this function for any other condition then your criteria can be customized or any operator according to the result you want.

How Do You employ the COUNTIF Function to Count Non-Empty Cells in Excel?

You can tally the cells that possess Numerical Values, Text Values, or Date Values. There are no limitations on the types of values when employing the COUNTIF Function. The COUNTIF function has the capability to enumerate the cells containing values, whether they are numerical, textual, or date-based; it consistently operates without any hurdle in all situations.

Let’s understand first how we can use the COUNTIF function to calculate the not blank cells for numerical Values:

  • Open any data sheet according to you, For better understanding we are using the below data in Excel. The data should contain both numerical values and blank cells to calculate the non-blank cells.

data sheet

  • As we can see in the above screenshot, a few days such as Wednesday and Friday both have blank cells in the Collection Column and the Rest cells have some values. Now we will use the COUNTIF function to calculate the non-blank cells in column B.
  • Next, Select any cells where you want to check your result and Go next to the “fx” button to insert the formula of the COUNTIF function.

fx

  • Now insert the Formula to calculate the not blank cells, The formula is mentioned below:=COUNTIF(range,”<>”&””)

    Here in our example, we have a Collection Starting from Column B2 and Ending at B8, So the Range for my function will be B2:B8 in our example.

B2:B8

 

  • Lastly, Just Click on the “Enter” button to get the result on the Selected cells.

Result

  • There might be a situation where you have a range of cells where you have a cell or multiple cells with space as a value in the cell which looks like a blank cell.

cells with space as a value

Using of COUNTIFS Function

So by following the below, you can use the COUNTIFS Function that will not include the cell that has spaces as values and gives the right count of not blank cells.

Use the Below formula, We are using range according to our example but you can make changes according to your cell range.

=COUNTIFS(B2:B8,”<>”&””,B2:B8,”<>”&” “)COUNTIFS Function

Here is the same example that we describe in the above scenario, In the above screenshot B6 cell has spaces as the value in it But by using the COUNTIFS Function we passed two criteria in the function, The First will work for Non-Empty cells and the Second for non-spaces cells. This way you can eliminate the cells that have spaces and get rid of this problem.

How to Count Blank Cells Using COUNTIF Function?

Similarly, Like using a COUNTIF Function for counting the not blank cells, You can use it reverse manner for counting the Blank cells in Excel. Sometimes Blank cells or empty data you need to find out from various columns and this function comes in handy for the user.

Below is the syntax and step-by-step procedure with an example of using the COUNTIF Function for counting Blank cells

Syntax:

=COUNTIF(Range,””)

Here in this function, we are replacing the “not equal to” (<>) operator with empty inverted commas that are “”.

Using of COUNTIF Function for Counting Blank Cells With the Example

Use the Below formula, We are using range according to our example, but you can make changes according to your cell range.

=COUNTIF(B2:B8,””&””)counting blank cells

So as we can see, There are only two cells that are blank in our above example that are B6 and  B4. Although the count of blank cells is 2, it is shown in the result.

If we try removing the value of one cell. For instance, removing B2 values and making it an empty cell, Let’s look at the results:Count of blank cells

Now the Count of blank cells is 3, so this way you can seamlessly handle all the count of blank cells in your Excel.

What are the Errors Occurred While Using the COUNTIF Function?

We all know that using any function in real practice invites lots of errors in Excel and the same can happen to you while using the COUNTIF Function for counting non blank cells. But we did a thorough research on this and addressed the most common issues that you may face. There can be several reasons such as using non-standard format of data and handling the data more than Excel limitation can bring unwanted errors in front of you.

 Below are the fixes for of some the most common issues:

1. Handling a Larger Datasheet

As we may know Excel can’t handle the data after a certain number of cells. It is obvious that every tool has some limitations beyond that it will work satisfactorily or you may face some error. The same applies in the case of Excel.

How to Deal With Larger Datasets: What you can do is divide the data into parts of sheets and try using formulas. Another way is using some more effective function such as SUMPRODUCT

That can make your work easier.

2. Use of Non-Standardized Data Format

Using the COUNTIF function for counting the non-blank cells only understands the data that is standardized in Excel or accepted by the Excel database. However, if you are using a nonstandard data format or any other format that is not understandable by Excel will give you errors only.

How to Deal With Non-Standardized Data: Always make sure that you are using the standard data format and recommend using the data cleaning techniques that will standardize the data according to Excel. Use the COUNTIF function only after formatting the data into standard format.

3. Validate the Data Before Using

To get the accuracy that results in the counting of not blank cells, it is advisable to validate the data and also ensure that it is in the required format.

How to Validate: Excel has provided a very good feature to validate your data, you can use the built-in validation techniques. For instance, using cell formatting and conditional formatting rules will always help you to figure out or sort out the incorrect data from the dataset, use them before using COUNTIF functionality.

4. Error Handling

You may face some common errors such as #VALUE and #REF if you are using the COUNTIF formulas. The reason for facing these errors is due to Criteria or range Either one of them is invalid or not properly used.

How to Deal With Errors: For handling this kind of error, Excel has an error-handling function such as IFERROR and you can also use the IF statement to show the message for a specific error so that you can get a cause of that error.

Excel Countif Function – FAQs

1. What is the difference between Countif and Countifs?

Ans: We can distinguish between the functions COUNTIF and COUNTIFS based on the utilization of ranges and criteria. Essentially, the COUNTIF function is capable of counting cells for a single criterion within a single range. However, COUNTIFS offers more versatility. You can specify multiple criteria for the same range or for different ranges. This flexibility allows you to choose the appropriate function based on your specific application.

2. Are there any other Excel functions that can be used to count non-blank cells?

Ans: Yes, there is a viable alternative to the COUNTIF function, which is COUNTA. This function operates similarly to the COUNTIF function. Additionally, the COUNTA function can count numeric values, text values, and date formats.

3. What is the difference between COUNTA and COUNTIF for counting non-blank cells?

Ans: The COUNTA function is capable of counting all cells within a designated range, regardless of whether they are empty or contain data. However, COUNTIF offers a more versatile functionality. With COUNTIF, you have the option to specify particular conditions for counting non-blank cells. Although it is possible to achieve similar results using COUNTA, it lacks the ability to incorporate specific criteria. Therefore, for more customized outcomes, COUNTIF serves as the ideal solution.

4. Can I use the COUNTIF function to count non-blank cells in multiple worksheets?

Ans: Yeah, it is possible to do so. The COUNTIF function can count all not blank cells from various worksheets. All you need to do is add references to cells from other Worksheets. The name of the Worksheet should followed by the exclamation mark. For instance, to calculate the count of not blank cells from a worksheet named “testsheet”,you can use functions like “=COUNTIF(testsheet!B2:B8,”<>”)”.

5. Can I combine COUNTIF with other Excel functions for more advanced calculations?

Ans: Yes, you can indeed achieve that. The COUNTIF function can be employed alongside other functions like SUM, and AVERAGE, and conditional functions such as IF. Through this approach, you can conduct more intricate calculations and advanced analysis of your data.

Conclusion

In conclusion, this article has provided a comprehensive understanding of the COUNTIF function. This function proves invaluable in saving time by tallying non-blank cells within Excel data. Its versatility extends to counting blank cells as well, with the added capability of specifying a range for more tailored results. The article has also walked through a step-by-step example of utilizing the COUNTIF function to count numeric values. Furthermore, it addresses the scenario of spaces being treated as values in cells, offering a solution through the COUNTIFS function.

Additionally, we’ve explored common errors that may arise when working with the function, such as non-standardized datasets and invalid data errors. Remedies for these issues have been provided, enhancing the guide’s utility.

It is hoped that this guide simplifies your work and encompasses all facets of employing COUNTIF for counting non-blank cells.

Leave a Reply

Your email address will not be published. Required fields are marked *