Hello Excecllers. Welcome back to another #ExcelTips blog post in my Excel series. This Excel tip tutorial will demonstrate how to count cells in your Excel selected range that contain text.
Using The COUNTIF Solution To Count Cells That Contain Text.
So, the first of two solutions is to use the COUNTIF formula or function. Just a quick recap for those who have not used COUNTIF before. It is one of Excel’s Statistical Functions and enables a count of the number of cells that meet a criterion. In this example, it is to count how many cells contain text.
=COUNTIF(range, criteria)
Where
- range = The range of cells that you want to count based on the criteria.
- criteria =The criteria used to determine which cells to count.
Let’s start the function. In this example, the range is cells B3:B6. So, the criteria we are using is the WILDCARD. This Let’s start the function. In this example, the range is cells B3:B6. The criteria we are using is the WILDCARD. WILDCARD is a special character that represents one or more unknown characters. The most widely used wildcard character is the asterisk (*). An example is below, which will be the basis for the function to count cells with text.
Tr* – this will match any words that begin with Tr, such as Train, Tracks or Trooper.
Work Through A COUNTIF Example.
YSo, yu get the idea right?. So, putting the full formula together it looks like this. By just using the wildcard itself any cells that contains text is counted towards to final COUNTIF calculations.
=COUNTIF(B3:B6,”*”)
Excel returns the correct result of 3 cells in the range that contain text. Note that the wildcard is not case sensitive and will not be affected by the text’s upper and lower case variations. That is how to use the COUNTIF function to count the number of cells that contain text.
So, if you enjoyed this Excel tip why not sign up for the How To Excel at Excel Newsletter. You will receive three FREE Excel tips every month direct your inbox. I also have some great offers on my personally recommended Excel courses. Why not join thousands of other Excellers getting better at Excel?. Use the link below. No spam.