How can I use COUNTA IF in Google Sheets?

COUNTA IF is a function in Google Sheets that allows you to count the number of cells in a given range that contain a certain value or meet a specific criteria. This function can be useful for tracking data and analyzing information in a spreadsheet. To use COUNTA IF, you would first specify the range of cells you want to count, followed by the criteria that must be met for a cell to be included in the count. This function can help you quickly and accurately calculate the number of cells that meet your specified conditions, saving you time and effort in data analysis.


Often you may want to use the COUNTA function with an IF function in Google Sheets to count the number of cells that are not empty only if a cell in a corresponding column meets a certain requirement.

Fortunately you can just use the COUNTIFS function to accomplish this.

The following example shows exactly how to do so.

Example: Using COUNTA with IF in Google Sheets

Suppose we have the following dataset that shows the points scored by various basketball players:

Suppose we would like to count the number of players with “Guard” in the Position column but only if the corresponding cell in the Points column is not empty.

We can type the following formula into cell D2 to calculate this number:

=COUNTIFS(A2:A16, "Guard", B2:B16, "<>"&"")

The following screenshot shows how to use this formula in practice:

Google Sheets COUNTA IF

The formula returns a value of 5.

This means that there are 5 players with a value of “Guard” in the Position column where the corresponding value in the Points column is not empty.

We can verify this is correct by manually identifying the five players that meet these criteria:

Each of the highlighted rows contains a player with a value of “Guard” in the Position column where the corresponding value in the Points column is not empty.

Note: You can find the complete documentation for the COUNTIFS function in Google Sheets .

Additional Resources

The following tutorials explain how to perform other common tasks in Google Sheets:

x