Count for words in excel

There is one option that I always wish Excel should have, and that is counting the number of words from a cell. If you work in MS Word there is an inbuilt option on the status bar which shows you how many words are there in the sheet.

there is an option in word to count words but not in excel

But when it comes to Excel there is no such option to count words. You can count the number of cells which have text but not actual words in them. As you know, in Excel, we have functions and you can use them to calculate almost everything. You can create a formula that can count words from a cell.

Today in this post, you will learn how to count words in Excel from a cell, a range of cells, or even the entire worksheet. And I’ll also show you how to count a specific word from a range of cells.

1. Count Words from a Single Cell

To count words from a cell you need to combine the LEN function with the SUBSTITUTE function. And the formula will be (Text is in cell A1):

=LEN(A1)-LEN(SUBSTITUTE(A1," ",""))+1

When you refer to a cell using this formula, it will return 7 in the result. And yes, you have a total of 7 words in the cell.

How it Works

Before getting into this formula just think this way. In a normal sentence if you have eight words then you will definitely have 7 spaces in those words. Right?

That means you will always have one word more than the spaces. The idea is simple: If you want to count the words, count the spaces and add one to them. To understand this formula you need to split it into three parts.

In the first part, you used the LEN function to count the number of characters from cell A1. And in the second and third parts, you have combined SUBSTITUTE with LEN to remove spaces from the cell and then count the characters. At this point, you have an equation like this.

The total number of characters with spaces and the total number of characters without spaces. And when you subtract both numbers get the number of spaces and in the end, you must add one to it. It returns 7 in the result which is the total number of words in the cell.

Important: When you use the above formula it will return 1 even if the cell is blank so it’s better to wrap it with the IF function to avoid this problem.

=IF(ISBLANK(A2),0,LEN(A2)-LEN(SUBSTITUTE(A2," ",""))+1)

This formula will first check the cell and only return the word count if there is a value in the cell.

2. Using a UDF

Apart from the above formulas, I have written a small code to create a UDF for this. This code will help you to create a custom function that will simply return the word count. In short, you don’t need to combine any functions.

Function MyWordCount(rng As Range) As Integer

MyWordCount = UBound(Split(rng.Value, " "), 1) + 1

End Function

Let me tell you how to use it.

  1. First of all, enter this code in VBA editor.
    add-udf-code-to-vbe-to-count-words-in-excel-cell
  2. And then come back to your worksheet, and enter “=MyWordCount(” and refer to the cell in which you have value.

And it will return the word count.

Related: Formula Bar in Excel

3. Count Words from a Range of Cells

Now let’s come to the next level. And here you need to count words from a range of cells instead of a single cell. The good news is you just need to use the same formula (just a simple change) which you have used above. And the formula will be:

=SUMPRODUCT(LEN(A1:A11)-LEN(SUBSTITUTE(A1:A11," ",""))+1)

In the above formula, A1:A11 is the range of cells and when you enter the formula it returns 77 in the result.

How it Works

This formula works in the same way as the first method works but is just a small advance. The only difference is you have wrapped it in SUMPRODUCT and referred to the entire range instead of a single cell.

Do you know that SUMPRODUCT can take arrays? So, when you use it, it returns an array where you have a count of words for each cell. And in the end, it sums those counts and tells you the count of words in the column.

4. Word Count from the Entire Worksheet

This code is one of the useful macro codes which I use in my work, and it can help you to count all the words from a worksheet.

Sub Word_Count_Worksheet()

Dim WordCnt As Long
Dim rng As Range
Dim S As String
Dim N As Long

For Each rng In ActiveSheet.UsedRange.Cells
S = Application.WorksheetFunction.Trim(rng.Text)
N = 0

If S <> vbNullString Then
N = Len(S) – Len(Replace(S, " ", "")) + 1
End If

WordCnt = WordCnt + N

Next rng

MsgBox "There are total " & Format(WordCnt, "#,##0") & " words in the active worksheet"

End Sub

When you run it, it will show a message box with the number of words you have in the active worksheet.

Related: What is VBA in Excel

5. Count a Specific Word/Text String from a Range

Here you have a different situation. Let’s say you need to count a specific word from a range of cells or check the number of times a value appears in a column.

Take this example: Below you have a range of four cells and from this range, you need to count the count of occurrences of the word “Monday”.

For this, the formula is:

=SUMPRODUCT((LEN(D6:D9)-LEN(SUBSTITUTE(D6:D9,"Monday","")))/LEN("Monday"))

And when you enter it, it returns to the count of the word “Monday”. That’s 4.

Important: It returns the count of the word (word’s frequency) from the range not the count of the cells which have that word. Monday is there four times in three cells.

How it Works

To understand this function, again you need to split it into four parts. In the first part, the LEN function returns an array of the count of characters from the cells.

The second part returns an array of the count of characters from the cells by removing the word “Monday”.

In the third part, the LEN function returns the length of characters of wor word “Monday”.

After that, subtracts part one from part two and then divides it with part three it returns an array with the count of the word “Monday” from each cell.

In the fourth part, SUMPRODUCT returns the sum of this array and gives the count of “Monday” from the range.

Download Sample File

  • Ready

Conclusion

Whenever you are typing some text in a cell or a range of cells you can these methods to keep a check on the word count. I wish someday in the future Excel will get this option to count words. But, for the time being, you have all these awesome methods.

Which method do you like the most? Make sure to share your views with me in the comment section, I’d love to hear from you. And please, don’t forget to share this post with your friends, I am sure they will appreciate it.

Want to get the word count in Excel? Believe it or not, Excel does not have an inbuilt word counter.

But don’t worry.

A cool bunch of excel functions (or a little bit of VBA if you’re feeling fancy) can easily do this for you.

In this tutorial, I will show a couple of ways to count words in Excel using simple formulas. And at the end, will also cover a technique to create a custom formula using VBA that will quickly give you the word count of any text in any cell.

Formula to Get Word Count in Excel

Before I give you the exact formula, let’s quickly cover the logic to get the word count.

Suppose I have a sentence as shown below for which I want to get the word count.

Word Count in Excel - formula

While Excel cannot count the number of words, it can count the number of spaces in a sentence.

So to get the word count, we can count these spaces instead of words and add 1 to the total (as the number of space would be one less the number of words).

Now there can be two possibilities:

  1. There is a single space between each word
  2. There are multiple spaces between words.

So let’s see how to count the total number of words in each case.

Example 1 – When there is a single space between words

Let’s say I have the following text in cell A1: Let the cat out of the bag

Word Count in Excel - formula

To count the number of words, here is the formula I would use:

=LEN(A1)-LEN(SUBSTITUTE(A1," ",""))+1

This would return ‘7’ as a result.

Here is how this formula works:

  • LEN(A1) – This part of the formula returns 26, which is the total number of characters in the text in cell A1. It includes the text characters as well as the space characters.
  • SUBSTITUTE(A1,” “,””) – This part of the formula removes all the spaces from the text. So the result, in this case, would be Letthecatoutofthebag.
  • LEN(SUBSTITUTE(A1,” “,“”) – This part of the formula counts the total number of characters in the text that has no spaces. So the result of this would be 20.
  • LEN(A1)-LEN(SUBSTITUTE(A1,” “,“”)) – This would subtract the text length without spaces from the text length with spaces. In the above example, it would be 26-20 which is 6.
  • =LEN(A1)-LEN(SUBSTITUTE(A1,” “,“”))+1 – We add 1 to the overall result as the total number of spaces is one less than the total number of words. For example, there is one space in two words and two spaces in three words.

Get Word Count in Excel - Example 1

Now, this works well if you have only one space character between words. But it wouldn’t work if you have more than one space in between words.

In that case, use the formula in the next example.

Example 2: When there are multiple spaces between words

Let’s say you have the following text: Let the cat   out of    the bag

Word Count in Excel - multiple spaces

In this case, there are multiple space characters between words.

To get the word count, we first need to remove all the extra spaces (such that there is only one space character between two words) and then count the total number of spaces.

Here is the formula that will give us the right number of words:

=LEN(TRIM(A1))-LEN(SUBSTITUTE(A1," ",""))+1

This is a similar formula used in the above example, with a slight change – we have also used the TRIM function here.

Excel TRIM function removes any leading, trailing, and extra spaces (except single spaces between words).

The rest of the formula works the same (as explained in Example 1).

Get Word Count in Excel - Example 2

Note: If there are no spaces between words, it is considered as one word.

Using VBA Custom Function to Count Words in Excel

While the above formulas work great, if you have a need to calculate the word count often, you can use VBA to create a custom function (also called a User Defined Function).

The benefit of using a custom function is that you can create it once and then use it like any other regular Excel function. So instead of creating a long complex formula as we did in the two examples above, you have a simple formula that takes the cell reference and instantly gives you the word count.

Here is the code that will create this custom function to get the word count in Excel.

Function WordCount(CellRef As Range)
Dim TextStrng As String
Dim Result() As String
Result = Split(WorksheetFunction.Trim(CellRef.Text), " ")
WordCount = UBound(Result()) + 1
End Function

Once created, you can use the WordCount function just like any other regular Excel function.

Custom Function Created with VBA to get the word count in Excel

In the above code for the custom function, I have used the worksheet TRIM function to remove any leading, trailing, and double spaces in between words. This ensures that all the three cells give the same result, as only the words are counted and not the double spaces.

How this formula works:

The above VBA code first uses the TRIM function to remove all the leading, trailing and double spaces from the text string in the referenced cell.

Once it has the cleaned string, it uses the SPLIT function in VBA to split the text string based on the delimiter, which we have specified to be the space character. So each word is separated as stored as a separate item in the Result variable.

We then use the UBOUND function to count the total number of items that got stored in the Result variables. Since VBA has a base of 0, we need to add 1 to get the total number of words.

This means that Result(0) stores the first word, Result(1) stores the second word, and so on. Since this counting starts from 0, we need to add 1 to get the real word count.

Where to Put this Code?

When creating a custom function, you need to put the code in the VB Editor of the workbook (which is the back end of the workbook where you can write code to automate tasks and create custom functions).

Below are the steps to put the code for the ‘GetNumeric’ function in the workbook.

  1. Go to the Developer tab.Word Count in Excel - Ribbon for Developer Tab
  2. Click on Visual Basic option. This will open the VB editor in the backend.Click on Visual Basic button in the Excel ribbon
  3. In the Project Explorer pane in the VB Editor, right-click on any object for the workbook in which you want to insert the code. If you don’t see the Project Explorer go to the View tab and click on Project Explorer.
  4. Go to Insert and click on Module. This will insert a module object for your workbook.Saving a Custom Function code in the module
  5. Copy and paste the code in the module window.

Once you have copied the code in the code window, you can go back to your worksheet and use this function just like any other regular Excel function.

Just type =Word and it will show you the formula in the list.

VBA Custom Formula shows up in Worksheet

It takes one argument, which is the cell reference and instantly gives you the word count in it.

You May Also Like the Following Excel Tutorials:

  • How to Count Cells that Contain Text Strings.
  • Using Multiple Criteria in Excel COUNTIF and COUNTIFS Function.
  • How to Add Leading Zeroes in Excel.
  • Remove Spaces in Excel – Leading, Trailing, and Double.
  • How to Extract the First Word from a Text String in Excel

Count Words in a Cell of Excel

There is no in-built excel formula to find the Word Count and therefore, it needs to be entered manually. You can make use of the formula below to calculate wordcount in excel –

=LEN(TRIM(cell))-LEN(SUBSTITUTE(cell,” “,””))+1

Let us understand the working of this formula.

To begin with, we utilize the SUBSTITUTE functionSubstitute function in excel is a very useful function which is used to replace or substitute a given text with another text in a given cell, this function is widely used when we send massive emails or messages in a bulk, instead of creating separate text for every user we use substitute function to replace the information.read more to evacuate and displace all spaces in the cell with a vacant content string (“). The LEN functionThe Len function returns the length of a given string. It calculates the number of characters in a given string as input. It is a text function in Excel as well as an inbuilt function that can be accessed by typing =LEN( and entering a string as input.read more restores the length of the string without spaces.

Next, we subtract the string length without spaces from the absolute length of the string. The number of words in a cell is equivalent to the number of spaces plus 1. So, we add 1 to the word count.

Further, we utilize the TRIM functionThe Trim function in Excel does exactly what its name implies: it trims some part of any string. The function of this formula is to remove any space in a given string. It does not remove a single space between two words, but it does remove any other unwanted spaces.read more to remove extra spaces in a cell. A worksheet may contain a lot of imperceptible spaces. Such coincidental occurrence might be towards the start or end of the text (leading and trailing spaces). Since extra spaces return an incorrect word count, the TRIM function is used before computing the length of the string.

The steps to count the total number of words in a cell of Excel are listed as follows:

  1. Select the cell in the Excel sheet where you want the result to appear.

    Word-Count-Example-1

  2. For counting the number of words in cell A1, enter the formula shown in the following image.

    Word-Count-Example-1-1-1

  3. Click “Enter” and the exact number of words appear in cell B1.

    Word-Count-Example-1-2

Table of contents
  • Count Words in a Cell of Excel
    • How to Count the Total Number of Words in a Range of Cells?
    • How to Count Specific Words in a Range?
    • Frequently Asked Questions
    • Recommended Articles

How to Count the Total Number of Words in a Range of Cells?

To count the number of words in a range of cells, apply the equation that counts the words in a cell and implant it either inside the SUM or the SUMPRODUCT function.

The formula to count words of a particular range is “=LEN(TRIM(cell))-LEN(SUBSTITUTE(cell,” “,””))+1.”

  • Step 1: Select the range of data whose words you wish to count.

Word Count Example 2

  • Step 2: Enter the formula in the cell where you want the result to display as shown in the succeeding image.

Word Count Example 2-1

  • Step 3: Click “Enter” and the result appears in cell B1.

Example 2-2

  • Step 4: Drag the fill handle to all cells to get the word count of each cell in Excel.

Example 2-3

How to Count Specific Words in a Range?

To count the number of times a specific word appears in a range of cells, we utilize a comparative methodology. We count the explicit words in a cell and consolidate it with the SUM or SUMPRODUCT functionThe SUMPRODUCT excel function multiplies the numbers of two or more arrays and sums up the resulting products.read more.

  • Step 1: Select the cell and enter the formula “=(LEN(cell)-LEN(SUBSTITUTE(cell,word,””)))/LEN(word)” as shown in the following image.

Example 4

  • Step 2: Click “Enter” to see the word count in cell A14. The formula we used above helps us know the number of times the word “February” is present in cell A2.

The result in cell A14 is 4.

Example 4-1

Frequently Asked Questions

#1 – How to count the number of times a single character appears in a cell?

The formula to count the occurrence of a single character in a cell is stated as follows:
=LEN(cell_ref)-LEN(SUBSTITUTE(cell_ref,”a”,””))

The “cell_ref” stands for cell reference. The letter “a” stands for the character that the user wants to count.

#2 – How to count the number of times a single character appears in a range of cells?

The formula to count the occurrence of a single character in a range of cells is stated as follows:

=SUM(LEN(range)-LEN(SUBSTITUTE(range,”a”2,””)))

The “range” stands for the range of cells to which the formula is applied. The letter “a” stands for the character that the user wants to count.

#3 – How to count the number of times a specific word appears in a row or a column?

The steps to count the number of times a particular word appears in a row or a column are listed as follows:

1- Select the row or the column in which the word is to be counted. The row is selected by clicking the number on the left-hand side. The column is selected by clicking the letter that appears on top of the column.
2 – In the formula tab, click “Define Name” and enter a name for the row or the column in the “New Name” box.
3 – If the column is named “NamesColumn,” the cells in this column will use “NamesColumn” for reference.
4 – Apply the formula “=COUNTIF(NamesColumn,”Jack”)” to count the number of times “Jack” appears in the “NamesColumn.”

Note: Every time a new name is added to a cell of “NamesColumn,” the result of the formula will automatically update.

  • The formula to count words of a particular range is “=LEN(TRIM(cell))-LEN(SUBSTITUTE(cell,” “,””))+1.”
  • The word count formula is combined with the SUM or SUMPRODUCT function to handle arrays.
  • The SUBSTITUTE function replaces all the spaces of the cell with a vacant content string (“).
  • The LEN function restores the length of the string without spaces.
  • The TRIM function removes the leading and trailing spaces found at the beginning or at the end of the text.
  • The number of words in a cell is equivalent to the number of spaces plus 1.

Recommended Articles

This has been a guide to Word Count in Excel. Here we discuss how to count the total number of words in a cell and an excel range along with practical examples and a downloadable template. You may learn more about Excel from the following articles –

  • Count Rows in Excel | ExamplesThere are numerous ways to count rows in Excel using the appropriate formula, whether they are data rows, empty rows, or rows containing numerical/text values. Depending on the circumstance, you can use the COUNTA, COUNT, COUNTBLANK, or COUNTIF functions.read more
  • Count Colored Cells In ExcelTo count coloured cells in excel, there is no inbuilt function in excel, but there are three different methods to do this task: By using Auto Filter Option, By using VBA Code, By using FIND Method.
    read more
  • Excel Count FormulaThe COUNT function in excel counts the number of cells containing numerical values within the given range. It is a statistical function and returns an integer value. The syntax of the COUNT formula is “=COUNT(value 1, [value 2],…)”
    read more
  • How to Count Unique Values in Excel?In Excel, there are two ways to count values: 1) using the Sum and Countif function, and 2) using the SUMPRODUCT and Countif function.read more
  • Compare Two Lists in ExcelThe five different methods used to compare two lists of a column in excel are — Compare Two Lists Using Equal Sign Operator, Match Data by Using Row Difference Technique, Match Row Difference by Using IF Condition, Match Data Even If There is a Row Difference, Partial Matching Technique.read more

no-override

Reader Interactions

Excel doesn’t have a dedicated function for counting words in a cell. However, with a little ingenuity, you can create such a formula using the SUBSTITUTE and LEN functions, with help from TRIM, as shown in the example. At a high level, this formula uses the LEN function to count the number of characters in the cell, with and without spaces, then uses the difference to figure out the word count. This works, because word count is equal to the number of spaces + 1, so long as there is one space between each word.

The first part of the formula counts the characters in cell B5, after removing extra space:

=LEN(TRIM(B5)) // normalize space, count characters

Inside LEN, the TRIM function first removes any extra spaces between words, or at the beginning or end of the text. This is important, since any extra spaces will throw off the word count. In this case, there are no extra space characters, so TRIM returns the original text directly to the LEN function, which returns 30:

LEN("All Quiet on the Western Front") // returns 30

At this point, we have:

=30-LEN(SUBSTITUTE(B5," ",""))+1

Next, we use the SUBSTITUTE function to remove all space characters from the text:

SUBSTITUTE(B5," ","") // strip all space

Notice SUBSTITUTE is configured to look for a space character (» «), and replace with an empty string («»). By default, SUBSTITUTE will replace all spaces. The result is delivered directly to the LEN function, which returns the count:

LEN("AllQuietontheWesternFront") // returns 25

LEN returns 25, the number of characters remaining after all space has been removed. We can now simplify the formula to:

=30-25+1 // returns 6

which returns 6 as a final result, the number of words in cell B5.

Dealing with blank cells

The formula in the example will return 1 even if a cell is empty, or contains only space. This happens because we are adding 1 unconditionally, after counting space characters between words. To guard against this problem, you can adapt the formula as shown below:

=LEN(TRIM(B5))-LEN(SUBSTITUTE(B5," ",""))+(LEN(TRIM(B5))>0)

Notice we’ve replaced 1 with this expression:

LEN(TRIM(B5))>0

This code first trims B5, then checks the length. If B5 contains text, LEN returns a positive number, and the expression returns TRUE. If B5 is empty, or contains only space, TRIM returns an empty string («») to LEN. In that case, LEN returns zero (0) and the expression returns FALSE. The trick is that TRUE and FALSE evaluate to 1 and zero, respectively, when involved in any math operation. As a result, the expression only adds 1 when there is text in B5. Otherwise, it adds zero (0). This logic could also be written with the IF function statement like this:

IF(LEN(TRIM(B5))>0,1,0)

and the result would be the same. The expression above is simply more compact.

Count Words in Excel

Excel Word Count (Table of Contents)

  • Introduction to Count Words in Excel
  • How to Count Words in Excel by using formulas?

Introduction to Count Words in Excel

In this topic will learn how to count a specific or total number of words in a cell or a cell range in excel by using formulas.

Unlike the MS office, where we can easily count the number of words, MS Excel doesn’t have a built-in function. However, we can count words in Excel by combining various functions to make a formula for the same.

We will use excel functions like TRIM, LEN, and SUBSTITUTE to make a formula that will yield words.

Let me give you the overview of these functions one by one –

  • Trim: This function removes duplicate or extra spaces from a cell or a cell range. The spaces could even be found before or after the word in a cell.
  • Len: This function returns the length of a string in a cell or a cell range. It includes spaces as well.
  • Substitute: This function replaces anything in a cell by any text, number etc., of our choice. In our case, this function will replace spaces with blanks.

We will now look into different scenarios of word count with examples in excel. We will also learn how to write syntax by combining the above three functions to get the word count in excel.

How to Count Words in Excel by using formulas?

Count words in excel are very simple and easy. Let’s understand the working of count words in excel using formulas with its examples.

You can download this Count Word Excel Template here – Count Word Excel Template

Example #1 – Count Total words in a cell

To get the count of words in a cell, we will use the below syntax:

=LEN(TRIM(cell))-LEN(SUBSTITUTE(cell,” “,””))+1

There is a text string in cell A2, and we want to count the total number of words. So it will be shown in cell B2.

Excel Data Example 1-1

We will first use the function Trim as below:

Count Word Example 1-2

Press Enter.

Count Word Example 1-3

Now, we get the text without any extra spaces. Sometimes a worksheet could have a duplicate or more than one space between words or spaces at the start or end of the text. The trim function removes all those extra spaces. It is good to use this function as a caution to get the correct result.

We will calculate the length of the string now, as shown below:

Count Word Example 1-4

Press Enter to get the length of the string without any space.

Count Word Example 1-5

Now, we will use a SUBSTITUTE function to replace the old text with the new in the string. Here we will replace the spaces “ “ with blanks. “

Count Word Example 1-6

Press Enter, and now we see the string without any spaces.

Count Word Example 1-7

Now to get the length of the string without spaces, we will use the LEN function as shown below:

Count Word Example 1-8

Press Enter to get the length of the string without spaces.

Count Word Example 1-9

Finally, to get the count of words in the string, we will subtract the length of the string with spaces (40) with the length of the string without spaces (35) and by adding 1 to it. Adding 1 will give us the total number of words, as spaces are one less than words.

Count Word Example 1-10

Press Enter, and you will see the exact count of words in the string in cell A2.

Count Word Example 1-11

This is how we will use the formula to count the total number of words in excel. In case we have multiple strings for word count in excel, as shown below.

Count Word Example 1-12

We just need to drag the cell B2 downwards, and the formula will be applied for all the strings.

Count Word Example 1-13

In case any of the above cells in the range A2:A5 has no text or is blank, the formula would then return the word count as 1 instead of 0 for that specific cell. This scenario is shown below:

Count Word Example 1-14

We can modify our formula by adding the IF function to avoid any such incorrect results, making it conditional. For example, we will use IF to give a condition to the cell that if it is blank, it should return the word count as 0.

The modified formula will be like this:

=IF(cell = ““,0,LEN(TRIM(cell))-LEN(SUBSTITUTE(cell,” “,””))+1)

On the above data, it will be applied in the below manner.

Count Word Example 1-15

Drag the cell B2 downwards, and the formula will be applied for all the strings.

Count Word Example 1-16

Example #2 – Count Total words in a cell

We have a long sentence to count the numbers of words in it.

Excel Data Example 2-1

First, we will get the length of cell A2, which has no extra space. Then we will substitute the spaces in the sentence with the blanks and get its length. Finally, we will subtract the total length of the sentence with the length of the sentence without spaces. Also, we will add 1 to get the final word count. This is because, in a cell, a number of words will be a number of space +1.

Count Word Example 2-2

Press Enter to see the result.

Count Word Example 2-3

I hope you have now understood the formula and will be able to write. It is a bit tricky but writing this 2 or 3 times will give you more clarity.

Example #3 – Count Specific words in a cell

How can we count as to how many times a specific name or a text has appeared in a string? We can do it by the below formula:

=(LEN(Cell)-LEN(SUBSTITUTE(CELL,word,””)))/LEN(word)

There a text string in cell A2, and we want to count the specific words in a cell. It will be shown in cell B2.

Excel Data Example 3-1

Let’s say we want to know how many times the word “home” has occurred in the above sentence. We can know this by the below formula:

Count Word Example 3-2

Press Enter to see the result.

Result of Specific words in a cell 

We will first calculate the length of the original text (A2). Now the SUBSTITUTE function will completely replace the word “home” in the sentence with blanks. With the LEN function, we will get the length of text A2 with the original word that is “home”. After that, we will subtract the length of this new text string from the length of the original text string. We will subtract 102-90, and that will give us 12.

And lastly, we will divide the above number with the length of the word “home”,4. This will give us the result 3. The word “home” has occurred 3 times in the above string.

Also, we can use a cell reference to the word in place, “home”.

Example #4 – Count total number of words in a Range

In case we want to the total number of words in a range, we can do so as below:

Excel Data Example 4-1

To calculate the total number of words, we will include a Sum function. For the Sum function, to calculate the array, we will press Ctrl+Shift+Enter instead of normal Enter.

Total Number of Words in a Range

Example #5 – Count the total number of a specific word in a Range

If we want to know the total number of occurrence of a specific word in a range, we can do it with the below formula:

In this example, we want to know the total number of times the word “London” occurred in the below range A2:A4. 

Excel Data Example 5-1

We can know this with the below formula:

Total Number of Specific Word in a Range

Once we have written the formula, we will press CTRL+SHIFT+Enter to get the result as the Sum function will calculate the array. Once we press the above keys, we will get the below result.

Count Word Example 5-3

In cell range A2:A4, the word “London” has occurred 3 times. Also, you can use a cell reference in place of the word “London”.

Things to Remember About Count Word in Excel

  • As a practice, use the TRIM function in writing the formula as it will eliminate the chances of error if the cell or range has extra spaces.
  • Whenever you want to know the count of a specific text in a cell or range, always write that word in double-quotes in the formula like “word”.
  • SUBSTITUTE is case sensitive, so be careful in writing the word that you want to substitute. It should be in the same case as it is in the original text, else it won’t be substituted.
  • Always press Ctrl+Shift+Enter to calculate the array SUM formula.

Recommended Articles

This has been a guide to Count Word in Excel. Here we discuss how to count words in Excel by using formulas along with excel examples and a downloadable excel template. You may also look at these suggested articles –

  1. Count Unique Values in Excel
  2. COUNTIF Excel Function
  3. Excel Count Function
  4. Count Characters in Excel

Понравилась статья? Поделить с друзьями:
  • Count excel cells that are not empty
  • Count duplicates in excel as one
  • Count distinct values in excel
  • Count days from date excel
  • Count columns with values excel