In this tutorial, you will learn how to get the word count in Google Sheets.
How to Get Word Count in Google Sheets
Knowing the word count in a Google Sheets document can be helpful for a variety of reasons. For example, you may be setting a limit on the number of words to include in a given field.
While the word count is easily accessible in Google Docs, Sheets does not have a built-in function that we can use to obtain the word count of a given cell.
Fortunately, you can easily get the word count in Google Sheets using a custom formula that uses the COUNTA and SPLIT functions.
In this guide, we will show you how to use this custom formula to calculate the word count of a string in Google Sheets.
How to Calculate the Word Count in Google Sheets
Here’s how to calculate the word count in Google Sheets.
First, select the cell where you want to output the word count.
In this example, we have a list of text values in column A and we want to output the word count of each string in column B.
We can use the formula =IF(A2=””,””,COUNTA(SPLIT(A2,” “))) to count the number of words that appear in a given text.
The formula works by using the SPLIT function to split the text into multiple strings. We’ll use the COUNTA function to count the total number of strings the SPLIT function returns. The IF function helps handle the case where the provided text is just an empty string.
In the example above, we were able to count a total of two words in the string “Hello World!”
Use the AutoFill feature to find the word count of all the sample texts.
If you want to get the number of times a particular word appears in a text, we can use the formula =IF(A2=””,””,COUNTIF(SPLIT(A2,” “),”I”)). The formula is similar to the previous function except we use COUNTIF rather than COUNTA.
The COUNTIF function allows us to filter the results of the SPLIT function to only count the appearance of a particular string.
This guide should be everything you need to find the word count of a text in Google Sheets.
You may make a copy of this example spreadsheet to test it out on your own.