Home » Google Sheets: How to COUNTIF Not Equal to Text

Google Sheets: How to COUNTIF Not Equal to Text

by Erma Khan

You can use the following formula in Google Sheets to count the number of cells that are not equal to a specific text:

=COUNTIF(A2:A11, "some_string")

This particular formula counts the number of cells in the range A2:A12 that are not equal to “some_string.”

Note: The operator stands for “not equal” in Google Sheets.

The following example shows how to use this formula in practice.

Example: COUNTIF Not Equal to Text in Google Sheets

Suppose we have the following dataset that contains information about various basketball players:

We can use the following formula to count the number of cells in the Team column that are not equal to “Hawks”:

=COUNTIF(A2:A12,"Hawks")

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

Google Sheets COUNTIF not equal to text

From the output we can see that there are 8 cells not equal to “Hawks” in the Team column.

If you would like to count the number of cells not equal to several different text, you can instead use the COUNTIFS function.

For example, we can use the following formula to count the number of cells in the Team column that are not equal to “Hawks” or “Spurs”:

=COUNTIFS(A2:A12,"Hawks", A2:A12, "Spurs")

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

From the output we can see that there are 6 cells not equal to “Hawks” or “Spurs” in the Team column.

Additional Resources

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

Google Sheets: COUNTIF Greater Than Zero
Google Sheets: How to Use COUNTIF with OR
Google Sheets: How to Use COUNTIF From Another Sheet

Related Posts