Count the number of words in a cell in Microsoft Excel

In case you have a requirement to count the number of particular word is repeated in a cell then you must read this article. In this article, we will use combination of IF, LEN, TRIM & SUBSTITUTE functions to achieve the output.

 

Example: If the text is “Count the number of words in a cell” & we want to find out how many times character “t” is repeated or say any character, then we can simply use the combination of above functions  in order to get the result.

Following is the snapshot of sample data:

 

img1

 

  • In cell B2, the formula will be
  • =IF(LEN(TRIM(A2))=0,0,LEN(TRIM(A2))-LEN(SUBSTITUTE(A2,”t”,””)))

 

img2

 

  • This means character “t” has been repeated 2 times in the above string

In case the character is changed from “t” to “o” then we need to make slight adjustment in the formula i.e. replace “t” with “o”

  • In cell B2, the formula will be
  • =IF(LEN(TRIM(A2))=0,0,LEN(TRIM(A2))-LEN(SUBSTITUTE(A2,”o”,””)))

 

img3

 

  • This means character “o” has been repeated 3 times in the above string

If criterion is changed to character “e” then the formula will be

  • =IF(LEN(TRIM(A2))=0,0,LEN(TRIM(A2))-LEN(SUBSTITUTE(A2,”e”,””)))

 

img4

 

Note: if the criteria character is typed as “E” instead of “e” then the formula will show 0

 

img5

 

Conclusion: Now we can get the count of specific characters with ease which are repeated in a cell.

 

image 48

 

If you liked our blogs, share it with your friends on Facebook. And also you can follow us on Twitter and Facebook.

We would love to hear from you, do let us know how we can improve, complement or innovate our work and make it better for you. Write us at info@exceltip.com

 
 

Users are saying about us...

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Terms and Conditions of use

The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.

Visit Us On TwitterVisit Us On FacebookVisit Us On Google PlusVisit Us On Youtube