How to get Word Count and Letter Count in Excel Formula

.

Dear Readers,

Getting a word Count of a String kept in a Cell, is not so difficult but sometimes you just don’t get it how to do it. So keeping that in mind, I wrote all possible ways to get Word Count of a String. You can get it by Excel Formula as well as UDF (User Defined Function).
We will see both the methods one by one below:

1. Get Word Count by Excel Formula


=LEN(A1)-LEN(SUBSTITUTE(A1,” “,””))+1

Where:
A1: Cell Address, Where your String is there.

Note:

Here in this Formula, the limitation is that if there are more than One spaces between two words then the Spaces will also be counted as a Word and the Count will not be proper.

2. Get Word Count by User Defined Function (UDF) Macro

Put the below code in Regular Module of your Workbook.

Function GetWordCount(Cell As Range)
    GetWordCount = UBound(Split(Cell.Value, " ")) + 1
End Function

Now you can use the below Formula to get the Word Count
=GetWordCount(Cell Address)

3. Get Letter Count in Excel Formula

=LEN(A1)
Where:
A1: Cell Address, Where your String is there.

Note:

This will return the total count of letters in that cell, including spaces as well.

Buy a coffee for the author

Adsense

Download FREE Tools and Templates

There are many cool and useful excel tools and templates available to download for free. For most of the tools, you get the entire VBA code base too which you can look into it, play around it, and customize according to your need.

Convert PDF Tables to Excel with VBA | Step-by-Step Guide
Convert PDF Tables to Excel with VBA | Step-by-Step Guide

Convert PDF Tables to Excel with VBA | Step-by-Step Guide How to Convert PDF Tables to Excel Using Excel VBA (Macros) Extracting data from PDF tables into Excel can be tedious, but with Excel VBA (macros), you can automate this process and save time. This guide will...

Dynamic Arrays and Spill Functions in Excel: A Beginner’s Guide
Dynamic Arrays and Spill Functions in Excel: A Beginner’s Guide

In today's tutorial, we'll be diving into the exciting world of dynamic arrays and spill functions in Office 365 Excel. These features have revolutionized the way we work with data, providing a more flexible and efficient way to handle arrays. I am going to explain...

How to Declare a Public Variable in VBA
How to Declare a Public Variable in VBA

While programming in VBA sometimes you need to declare a Public Variable that can store the value throughout the program. Use of Public Variable: Let's say you have 4 different Functions in your VBA Code or Module and you have a variable that may or may not be...

What is Excel Formula?

Excel Formula is one of the best feature in Microsoft Excel, which makes Excel a very very rich application. There are so many useful built-in formulas available in Excel, which makes our work easier in Excel. For all the automated work, Excel Macro is not required. There are so many automated things can be done by using simple formulas in Excel. Formulas are simple text (With a Syntax) which is entered in to the Excel Worksheet Cells. So how computer will recognize whether it is a formula or simple text? Answer is simple.. every formula in Excel starts with Equal Sign (=).

You May Also Like…

0 Comments

Trackbacks/Pingbacks

  1. Learn Excel Macro How to create User Defined Function in Excel - [...] User Defined functions created: UDF – Is File Open? UDF to Convert Currency to Words UDF to Count Words…
  2. How to create User Defined Functions in Excel - Welcome to LearnExcelMacro.com - […] I will take an example from my previous article to explain this – UDF – to get Word Count…
  3. UDF to Convert Numbers to Letters - Spell Currency in Words - […] this is User Defined Function to convert numbers to words or in other words, spell numbers in Words. –…

Submit a Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Join and get a FREE! e-Book

Don't miss any articles, tools, tips and tricks, I publish here

You have Successfully Subscribed!

Pin It on Pinterest