# How to Count Cells That Contain Specific Text

This post will discuss that how to count the number of cells that contain specific text or certain text in a specified cells of range in Excel. How to get the total number of cells that contain certain text.

## Count Cells That Contain Specific Text

Assuming that you have a data of list in range B1:B6 that contains some office products and you want to count the number of cells that contain “Excel” in B1:B6. You can use the SUM function in combination with the IF function to create a complex Excel Array Formula as follows:

`{=SUM(IF(B1:B6="Excel",1,0)) }`

Note: when entering this formula into the formula box, you need to press Ctrl+Shift+Enter shortcuts to change this formula as an Array formula.

Let’s see how this formula works:

{=IF(B1:B6=”Excel”,1,0)} This formula will check each cell if it is equal to the specified text string “Excel”, if so, then return value 1. Otherwise, returns value 0.  So this array formula returns another array list like this: {1;0;0;0;0;1}. This array list will pass into the SUM function as its argument.

{=SUM(IF(B1:B6=”Excel”,1,0))} The SUM function will count the values in the array list that returned by the IF function. So it returns value 2.

You can also use another function COUNTIF to achieve the same result. You can use the following formula with COUNTIF function to count the number of cells that contain “Excel” text string in range B1:B6.

`=COUNTIF(B1:B6,"Excel")` The COUNTIF function will count the number of cells in the specified range that contain “Excel” string by matching the content of each cell. And you can also use the wildcard in the criteria argument of COUNTIF.

Another Excel formula can be used to count the number of cells that contain Excel text string, this formula will use the SUMPRODUCT function in combination with the ISNUMBER function and the FIND function as follows:

`=SUMPRODUCT(--(ISNUMBER(FIND("Excel",B1:B6))))` ### Related Functions

• Excel SUM function
The Excel SUM function will adds all numbers in a range of cells and returns the sum of these values. You can add individual values, cell references or ranges in excel.The syntax of the SUM function is as below:= SUM(number1,[number2],…)…
• Excel IF function
The Excel IF function perform a logical test to return one value if the condition is TRUE and return another value if the condition is FALSE. The IF function is a build-in function in Microsoft Excel and it is categorized as a Logical Function.The syntax of the IF function is as below:= IF (condition, [true_value], [false_value])….
• Excel COUNTIF function
The Excel COUNTIF function will count the number of cells in a range that meet a given criteria. This function can be used to count the different kinds of cells with number, date, text values, blank, non-blanks, or containing specific characters.etc.= COUNTIF (range, criteria)…
• Excel SUMPRODUCT function
The Excel SUMPRODUCT function multiplies corresponding components in the given one or more arrays or ranges, and returns the sum of those products.The syntax of the SUMPRODUCT function is as below:= SUMPRODUCT (array1,[array2],…)…
• Excel ISNUMBER function
The Excel ISNUMBER function returns TRUE if the value in a cell is a numeric value, otherwise it will return FALSE.The syntax of the ISNUMBER function is as below:= ISNUMBER (value)…
• Excel FIND function
The Excel FIND function returns the position of the first text string (sub string) within another text string.The syntax of the FIND function is as below:= FIND(find_text, within_text,[start_num])…
Related Posts
Case Sensitive Lookup with SUMPRODUCT and EXACT

Today, we will show you how to use SUMPRODUCT and EXACT to perform a case sensitive exact match. In this article, we provide a simple example to calculate bonus for employees whose names are case-sensitive. If you meet similar scenarios ...

Average per Week by Formula in Excel

We usually apply AVERAGE function or relevant functions to return average directly in Excel worksheet. But in some situations, only applying average relevant functions cannot figure out our problem. Sometimes we can create a formula with functions and mathematical operation ...

How to Sum if Equal to Many Items or A Range in Excel

If we want to sum numbers from a range with criteria, we often select SUMIF of SUMIFS functions as the first choice to create a formula. The criteria can be a number or an array or a collection of some ...

How to Sum if Equal to X or Y in Excel

In daily work, if we want to sum numbers from a range, and only sum the numbers which being equal to X or Y in the range, we can create a formula with Excel build-in functions to get the result. ...

How To Sum the Largest N Values in Excel

Sometimes we may want to sum the largest N numbers or top N numbers in a range. In this article, we will show you the method of “SUM the Largest N Numbers” by a simple formula which consist of SUMPRODUCT ...

How to Sum for Cell Contains Formula Only in Excel

Sometimes values are created by formulas in cells. If we want to sum values which are created by formulas from a range, but some values which are hardcoded also list in the same range, how can we filter out matched ...

How to Sum the Smallest N Values in Excel

Sometimes we may want to sum the first smallest N numbers in a range in Excel. In this article, we will show you the method of “SUM the Smallest N Numbers” by a simple formula which consist of SUMPRODUCT and ...

How to Sum by SUMPRDUCT with One Specific Criteria Multiple Columns in Excel

Sometimes we may meet the case that to sum numbers based on one specific criteria. In this article, we will show you the method to resolve this problem by formula with the help of Excel SUMPRODUCT function. SUMPRODUCT can filter ...

How to Sum by SUMPRDUCT with Specific Criteria in Excel

Sometimes we may meet the case that to sum numbers based on two or more specific criteria. In this article, we will show you the method to resolve this problem by formulas with the help of Excel SUMPRODUCT function. SUMPRODUCT ...

How to Count Unique Numeric Values in a Range in Excel

This post will guide you how to count unique numeric values in the given range in Excel 2013/2016 or Excel office 365. How do I count the unique numeric values in a list of data with some duplicate values using ...

Sidebar