Table of Contents
The COUNTA function in Excel is a useful tool for counting the number of cells that contain any type of data, including numbers, text, and logical values. By utilizing this function, one can easily determine the number of cells that meet a specific criteria, such as containing a certain word or value. This function is beneficial for data analysis and organization, as it provides a quick and efficient way to gather information and make informed decisions. To use the COUNTA function, simply select the desired range of cells and input the criteria in the function’s formula. The result will be the total number of cells that meet the specified criteria. This feature is particularly useful in large datasets, as it eliminates the need for manual counting and reduces the risk of errors.
Excel: Use COUNTA with Criteria
You can use the COUNTA function in Excel to count the number of cells in a range that are not empty.
However, sometimes may want to use the COUNTA function to count cells that are not empty and meet some additional criteria.
You can use the following basic syntax to do so:
=COUNTA(B2:B12)-COUNTIF(B2:B12,"0")
This particular formula counts all cells in the range B2:B12 that are not blank and are not equal to 0.
The following example shows how to use this syntax in practice.
Example: Using COUNTA with Criteria in Excel
Suppose we have the following dataset that shows the points scored by basketball players on various teams:

We can use the following COUNTA function with the COUNTIF function to count the number of cells in the Points column that are not empty and not equal to 0:
=COUNTA(B2:B12)-COUNTIF(B2:B12,"0")
The following screenshot shows how to use this formula in practice:

From the output we can see that there are 8 cells in the Points column that are not empty and not equal to zero.
Here’s what this formula actually did under the hood:
- COUNTA counted 10 blank cells.
- COUNTIF counted 2 cells equal to zero.
- Thus, COUNTA – COUNTIF produced 10 – 2 = 8.
Feel free to replace the value in the COUNTIF function to exclude whichever values you’d like from the COUNTA function.
The following tutorials explain how to perform other common tasks in Excel:
Cite this article
stats writer (2024). How can I use the COUNTA function in Excel to count cells with specific criteria?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-use-the-counta-function-in-excel-to-count-cells-with-specific-criteria/
stats writer. "How can I use the COUNTA function in Excel to count cells with specific criteria?." PSYCHOLOGICAL SCALES, 26 Jun. 2024, https://scales.arabpsychology.com/stats/how-can-i-use-the-counta-function-in-excel-to-count-cells-with-specific-criteria/.
stats writer. "How can I use the COUNTA function in Excel to count cells with specific criteria?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-use-the-counta-function-in-excel-to-count-cells-with-specific-criteria/.
stats writer (2024) 'How can I use the COUNTA function in Excel to count cells with specific criteria?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-use-the-counta-function-in-excel-to-count-cells-with-specific-criteria/.
[1] stats writer, "How can I use the COUNTA function in Excel to count cells with specific criteria?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, June, 2024.
stats writer. How can I use the COUNTA function in Excel to count cells with specific criteria?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.
