When you’re working with large datasets in Google Sheets, you will sometimes need to count cells with text in Google Sheets. This could be names, ids, or even dates.
But can Google Sheets count cells with text?
Luckily like most other spreadsheets, you can count text in Google Sheets.
And thanks to awesome formulas in Google Sheets, this can be done in seconds. The count functions in Google spreadsheet count cells with text.
In this tutorial, I will show you a couple of scenarios where you can count cells that contain specific text.
Using the COUNTIF function for Google Sheets to count cells with text is a simple process. The syntax for the COUNTIF function is written as follows:
Using this function, Google Sheets will count if contains a value in the range that meets the criterion.
- The range, in this case, specifies to Google Sheets to count the number of cells with text
- The criterion specifies which texts you want to be counted.
The COUNTIF Google Sheets formula counts cells with specific text by inputting the specified texts as the criterion.
Let’s look at an example to help you understand better.
Can Google Sheets Count Cells With Text With Specific Values?
Suppose you have a dataset, as shown below, and you want to quickly count the number of times the name ‘Mark’ occurs in column A.
Below is the formula you can use to do this:
Here is how this above COUNTIF formula works:
- The first argument of this formula is the range where you have the data, In this example, it’s A2:A13 which has the names
- The second argument is the criteria. This is what is used to check the value in the cell, and if this criterion is met, then the cell is counted. In this example, I have manually entered the name Mark in double quotes. If you have this criterion in a cell, you can use the reference here.
The above formula does a conditional count by going through all the cells in the range and counting those cells where the criterion text is present.
Note that the criterion text used in this formula is not case-sensitive. So whether you use MARK, Mark, or mark, the result would be the same.
In this example, I have used a name, but it could be any text – such as ids or numbers.
Count Cells That Do Not Contain a Specific Text
You can modify the COUNTIF function in Google spreadsheet count number of cells with text without using a specific text.
For example, if I have the dataset as shown below and I want to count all the cells where the name is not Mark, I can easily do this with the COUNTIF function.
Below is the formula that will give the count of all the cells where the name is not Mark:
The above formula uses the range of the cells as the first argument and the criteria used is “<>Mark”. Here the not-equal-to sign needs to be within the double quotes as well.
Count Cells That Contain Text (Anywhere in the Cell/Partial Match)
In the examples above, we let Google Sheets count the number of cells with text for the entire cell content .
So if we wanted to Google Sheets count if cell contains text specified, in this case the name Mark, we used “Mark” as the criterion. This counted all the cells where the entire cell content was ‘Mark’.
But let’s say, you have a dataset of full names (or some other text) along with the name and you want to count all the cells that contain the name ‘Mark’, then you can use the above formula.
In this case, you need to use the COUNTIF function with wild card characters.
Below is the formula that will give you the count of all the cells that have the word ‘Mark’ in it.
In the above function, the criterion is flanked by an asterisk symbol (*) on both sides.
As the asterisk sign (*) is a wildcard character that can represent any number of characters in a formula. This means that where this formula checks for the given condition, there could be any number of characters/words before and after the criteria.
In simple terms, if the word Mark (or whatever your criterion is) is present in the cell, this formula would count the cell.
Caution: One thing you need to remember when using the asterisk sign (*) to count if cell contains text in Google Sheets is that it would consider the condition met as soon as the criterion text is found. For example, in the above example, in case the cell contains the text Market or Marketing, these would be counted as these also contain the text ‘Mark’ – which is out criteria in the function.
In case you want to use the function for counting text in Google Sheets by checking for multiple criteria, you need to use the COUNTIFS function.
One of the questions I often get is whether you can use the COUNTIF function to count the cells with colors. Unfortunately, you can not. However, here is a tutorial where I show how you can easily filter and count cells based on color.
How to Count Cells with Text in Google Sheets Using the COUNTA Function?
You can also use the COUNTA Google Sheets formula to count cells with text. The COUNTA function counts the numeric values for the cells in the range that are not empty.
This includes cells with error values and empty texts, but it does not count any blank cells.
The syntax for the COUNTA function is:
COUNTA(value1, [value2], …)
Value1 (Required): Represents the values that you want to count.
Value2 (Optional): Represents additional values that you want to count, with a limit of 255 arguments.
To make the COUNTA function count cells with texts only instead of all the non-blank cells, you need to put in the arguments in the count function.
Here is a step-by-step guide on how to count cells with texts in Google Sheets using the COUNTA Function:
- Select the cell where you will put your formula.
- Type in the formula =COUNTA(A1:A10)
- This will return the number of cells with any text in them.
COUNTA vs COUNTIF vs LEN
The COUNTA function lets Google Sheets is like the “COUNTIF cell contains text” function, but it can also be any other value. To let Google Sheets count cells with specific text, you need to use COUNTIF functions instead. To count the number of characters in a cell, you will need to use the LEN function instead.
Google Sheets counting cells with text is an easy topic to tackle once you know what you’re doing. In this case, you can use count functions like the COUNTA function if you want to count cells with any text and the COUNTIF Google Sheets formula to count cells with specific text.
Hopefully, you were able to follow this guide on how to count cells with text in Google Sheets and we’ve answered the question, “Can Google Sheets count cells with text”. If you still need help, please let us know in the comments.
You may also like the following Google Sheets tutorials:
- How to Get the Word Count in Google Sheets
- How To Remove Duplicates In Google Sheets
- Count Cells IF NOT Blank (Non-Empty cells) in Google Sheets
- Remove the First Character from a String in Google Sheets
- Count the Number of Characters in a Cell in Google Sheets
- IFS Function in Google Sheet
- Count Cells based on the Cell Color in Google Sheets
9 thoughts on “Count Cells With Text in Google Sheets [2 Easy Functions]”
Splendid and perfect instructions. Thanks a 1,000! And greetings from Niterói, Rio de Janeiro, Brazil ❤️️ 👍 🖖
What if I want to count the number of times Mark appeared in a cell? Say example cell a1 contains mark / matt / alex / mark / jonathan / mark – this would ideally say 3 counts of mark, but using your formula, it would only count as 1 as they are in the same cell.
Thank you, this is useful. What if instead of expliciting the text inside the second argument I want to refer to a cell?
e.g. in C3 I have “Salad” and I want to count all cells in that range containing *C3* that I know migh change.
It doesn’t work with the cell.
When typing the formula, click the cell C3 instead of typing it and don’t use quote marks.
Helpful, but I’m looking for some other scenario like if I have a list of cities in the 1st column and the 2nd one contains multiple reasons.
Now I want to calculate all the data (from multiple sheets) on the main sheet containing Cities in column A and Reasons in columns B, C, D, E & F.
Hey Sumit, thanks for this post. What if instead of counting a simple text value I want to count how many occurrences of a text that is contained in a cell?
I tried =COUNTIF(A:A,”*A2*”) but it doesn’t work, Thank you
I am curious if it is possible to make the reference in the last part in the formula for searching for a part of the cell value (usings the wild cards) could be relative.
For example: i have a number of cells which I want the formula to check for:
B2: V C2: M D2: A E2: w
So I would the formula to check for the value in cell E2:
=COUNTIF(A2:A13,”*mark*”) would then become: =COUNTIF(A2:A13,E2)
But obviously, that doesn’t work as the wildcard/asterix is not present. So I made this:
=COUNTIF(A2:A13,””*””&E2&””*””) but that also does not work.
I tried to use the textjoin formula. But that also doesn’t seem to work.
Is it possible to use a relative cell reference combined with the asterix/wildcards to search for a specific string in a part of the matrix/cells?