Go Back

How to Count Cells that Contain Text

We can use the COUNTIF Function to count cells that contain text (not errors, not blanks, not numbers). COUNTIF is used with a wildcard (“*”) that matches any number of characters. The COUNTIFS function can be used to count cells without text. The steps below will walk through the process.

Figure 1: How to Count Cells that contain text

Syntax

=COUNTIF(rng,"*")

Formula

Count with text: =COUNTIF(B4:B11,"*")

Count without text: =COUNTIFS(B4:B11,"*",B4:B11,"<> ")

Setting up the Data

  • We will set up the data by inputting the Values into Column B
  • The count with text will be returned in Cell C4
  • The count without text will be returned in Cell C7

Figure 2: Setting up the Data

Count With Text

  • We will click on Cell C4
  • We will insert the formula below into the cell
    =COUNTIF(B4:B11,"*")
  • We will press the enter key

Figure 3: Result for Count of Cells with Text

Count Without Text

  • We will click on Cell C7
  • We will insert the formula below into the cell
    =COUNTIFS(B4:B11,"*",B4:B11,"<> ")
  • We will press the enter key

Figure 4: Result for Count of Cells without Text

Notes

 

  • Logical values like TRUE and FALSE aren’t counted as text
  • Unless a number is entered as text, it is not counted by “*”
  • Any blank cell that begins with an apostrophe (‘) will be counted.

 

Instant Connection to an Expert through our Excelchat Service

Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:
Here are some problems that our users have asked and received explanations on

I would like a formula to do the following: Count the number of cells that contain a value contained in another cell. The cells to be counted H2:I92 contains the same text as in T4. However, if the data contained in adjacent cells is the same, only count it once (ie if H3 and I3 both contain the text in T4).
Solved by F. B. in 15 mins
I would like to be able to search Columns D-X for cells that contain specific text and then hide all rows that do not contain that text
Solved by Z. U. in 25 mins
I want Excel to count a range of cells that contain specific data
Solved by B. L. in 13 mins

Leave a Comment

avatar