Count Cells with Text in Google Sheets: Best Methods
In this article
To count cells that contain text in Google Sheets, the most direct method is using the formula =COUNTIF(range, "*"). This specific formula uses a wildcard character (the asterisk) to identify any cell containing one or more text characters while ignoring purely numeric values and empty cells. This is essential for data cleaning, auditing lists, and managing spreadsheets where you need to distinguish between textual entries and numerical data.
What You'll Need
- A Google account with access to Google Sheets.
- A spreadsheet containing a mix of data types (text, numbers, and blanks) to test the formulas.
- Basic familiarity with how to select a range of cells (e.g., A1:A20).
Step-by-Step
- Open your Google Sheet: Navigate to the document containing the data you wish to analyze. Ensure the data is organized in columns or rows so you can easily define your range.
- Select the destination cell: Click on the empty cell where you want the final count to appear. It is usually best to place this at the bottom of your data column or in a separate summary table.
- Enter the COUNTIF formula: Type
=COUNTIF(into the cell. The COUNTIF function is designed to count cells based on a single criterion. - Define your range: While the formula is open, highlight the cells you want to check with your mouse, or type the range manually (for example,
A2:A100). The formula should now look like=COUNTIF(A2:A100,. - Add the text criterion: Type a comma, then enter
"*". The asterisk inside double quotation marks acts as a wildcard that represents any sequence of characters. This tells Google Sheets to count only cells that contain text. - Close the formula: Type the closing parenthesis
)and press Enter. Your sheet will now display the total number of cells in that range containing text. - Verify the result: Manually check a small sample of your data to ensure that numbers are being ignored and text entries are being counted correctly.
Common Mistakes
One of the most frequent errors is forgetting the double quotation marks around the asterisk. If you enter =COUNTIF(A1:A10, *), Google Sheets will return a formula parse error because it does not recognize the asterisk as a valid standalone value without the quotes. The quotes tell the system that the asterisk is a string literal acting as a wildcard.
Another common mistake is confusing COUNTIF with COUNT. The standard =COUNT() function only counts cells containing numbers. If you apply it to a column of names or addresses, the result will be 0, leading users to believe the formula is broken when it is simply the wrong tool for the job. Similarly, COUNTA counts everything that is not empty—including numbers, dates, and errors—which often leads to an overcount if you specifically only want text.
Users also frequently forget that cells containing formulas that return an empty string (like ="") are technically not empty. Depending on the version and the specific formula used, these might be counted as text even if the cell appears blank to the human eye. This can lead to discrepancies between your manual count and the formula result.
Tips
If you need to count cells that contain any data (text, numbers, or symbols), use the =COUNTA() function. This is the fastest way to determine how many slots in a range are filled, regardless of the data type. However, if your goal is strict text identification, stick to the wildcard COUNTIF method.
For more advanced users, combining SUMPRODUCT with ISTEXT provides a more robust way to count text. The formula =SUMPRODUCT(--ISTEXT(A1:A100)) works by checking every cell in the range to see if it is text (returning TRUE or FALSE) and then converting those booleans into 1s and 0s to be summed. This method is often more reliable when dealing with complex datasets where wildcards might behave unexpectedly.
To count cells that contain specific text rather than any text, replace the asterisk with the word you are looking for. For example, =COUNTIF(A1:A100, "Complete") will only count cells that exactly match the word "Complete". If you want to count cells that contain a specific word as part of a longer sentence, use the asterisk on both sides: =COUNTIF(A1:A100, "*Complete*").
Troubleshooting
If your formula is returning a 0 when you know there is text present, first check for leading or trailing spaces. While the wildcard "*" usually captures these, ensure that the cells aren't actually formatted as numbers that just look like text. For instance, a number stored as text will be counted, but a number formatted as a currency will not.
If you receive a #VALUE! or #ERROR! message, check your syntax. Ensure there is only one comma separating the range and the criterion. Check that you have used standard straight quotes (") rather than "smart quotes" or curly quotes (“ ”), which often happen if you copy and paste formulas from a word processor or a website. Google Sheets only recognizes standard programming quotes.
If the count seems too high, you may have hidden characters or formulas returning empty strings. To fix this, you can try using a more restrictive formula like =COUNTIFS(A1:A100, "*", A1:A100, "<>"), which ensures the cell is both text and not empty. If the problem persists, clear the formatting of the range by selecting the cells and going to Format > Clear formatting to ensure no strange data types are interfering with the count.
Frequently Asked Questions
Does the asterisk count cells with numbers?
No, the "*" wildcard in COUNTIF specifically targets text strings. It will ignore cells that contain only numbers, dates, or boolean values (TRUE/FALSE).
How do I count cells that are NOT text?
You can use the =COUNT() function to count only numbers, or use =COUNTIF(range, "<>*") to count cells that do not contain text strings.
Will this count cells that have a formula in them?
Yes, if the formula results in a text string, it will be counted. If the formula results in a number or is blank, it will be ignored by the "*" criterion.
Can I count text across multiple columns at once?
Yes, you can define a multi-column range. For example, =COUNTIF(A1:C100, "*") will count every cell containing text within the block from column A to column C.
What is the difference between COUNTA and COUNTIF with a wildcard?
COUNTA counts any cell that is not empty (text, numbers, errors). COUNTIF(range, "*") specifically filters for text, ignoring numbers and blanks.