Count Cells that Do Not Contain 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 that do not contain specific text.

count if not equal to text title

Count Cells that Do Not Contain Specific Text with COUNTIF

The COUNTIF Function counts all cells that meet a certain condition. We can use the COUNTIF Function along with the not equal to sign, <>, and the asterisk wildcard, *, to count cells that do not contain certain text.

In this example, we will count all cells that do not contain the text “Ash”:

=COUNTIF(A2:A11,"<>*Ash*")

count if not equal to text example 2

As highlighted above, since the cells A5 and A10 start with the word “Ash”, they are not counted.

Count Cells that Do Not Contain Specific Text with COUNTIF in Google Sheets

These functions also work the same way in Google Sheets as well.

=COUNTIF(Range, “<>*Ash*”)

count if not equal to text google sheets 2

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