Count Cells Not Equal To in Excel & Google Sheets

Written by

Editorial Team

Reviewed by

Steve Rynearson

Last updated on February 7, 2023
Download Example Workbook

Download the example workbook

This tutorial will demonstrate how to count cells not equal to using the COUNTIF Function in Excel and Google Sheets.

Count Cells Not Equal To in Excel

 

Count Cells Not Equal To with COUNTIF

The COUNTIF Function counts cells that meet certain criteria. You will be required to enter two fields: range and criteria.

In the example below, we want to count how many students have exam scores not equal to “Pass”.

=COUNTIF(D3:D11,"<>*Pass*")

Count Cells Not Equal to Pass

 

The symbol “<>” in Excel/Google Sheets is equivalent to “not equal to”. In this case, we are checking how many values in the range C2:C10 are not equal to “Pass”.

You will also notice that criteria is enclosed in quotation marks. Please note that this formula will not work if you do not have the quotation marks around the criteria.

 

You can also use the COUNTIF function for numeric criteria. As demonstrated in the above example, if you want to check how many students scored over 50, you can use the following formula:

=COUNTIF(C3:C11, ">"&50)

You will notice that in this example, our criterion is a number. For this reason, we will not enclose the 50 inside of the quotation marks.

Countif for Numeric Criteria

 

You can also use the COUNTIF function to reference another cell in its criteria.

Countif to Reference in Criteria

 

In this next example, we set up Data Validation with our criterion cell.

=COUNTIF(, “<>”&F3) [where F3 is the criteria you don't want your range to equal to]

count cells not equal to cell reference animated

You can see that Data Validation is a great tool for creating interactive dashboards.

Count Cells Not Equal To with COUNTIF in Google Sheets

The formulas above work in the exact same way in Google Sheets as well.

To count cells not equal to certain string criteria:

Count Cells Not Equal to Text in Google Sheets

To count cells not equal to/greater/less than numeric criteria:

Countif for Numeric Criteria in Google Sheets

AI Formula Generator

Try for Free

Excel Practice Worksheet

practice excel worksheet

Practice Excel functions and formulas with our 100% free practice worksheets!

  • Automatically Graded Exercises
  • Learn Excel, Inside Excel!

Free Download

Return to Excel Formulas List