How can I use COUNTA IF in Google Sheets?

The COUNTA IF function in Google Sheets allows users to count the number of cells within a range that meet a specific criteria. This function can be utilized to quickly and efficiently calculate the total number of cells that contain data or fulfill a certain condition. By using this function, users can easily track and analyze data in their Google Sheets spreadsheet, making it a useful tool for data management and analysis.

Use COUNTA IF in Google Sheets


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