You can use the following formula in Excel 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:A11** that are not equal to “some_string.”

**Note**: The **<>** operator stands for “not equal” in Excel.

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

**Example: COUNTIF Not Equal to Text in Excel**

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:A11, "<>Hawks")**

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

From the output we can see that there are 7 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:A11,"<>Hawks", A2:A11, "<>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 Excel:

Excel: Use COUNTIF with Multiple Ranges

Excel: Use COUNTIF with Multiple Criteria in Same Column

Excel: COUNTIF Greater Than But Less Than Some Number