How to count text in Excel?

Imagine your team members have entered all their project hours in a worksheet and you need to count it.

In other words, you also need to count the cells that have data. To complicate matters, the data may not be numeric. Some of your team members may have entered placeholder values such as “TBD”.

So can you count it in a simple way?!

Yes, You can count it using COUNTA Function!

Microsoft Excel has a handful of useful functions that can count nearly everything. The COUNT function is to count cells with numbers, COUNTA to count non-blank cells, COUNTIF and COUNTIFS to conditionally count cells and LEN to calculate the length of a text string.

Unfortunately, Excel doesn’t provide any built-in tool for counting the number of words. Luckily, by combining serval functions you can make more complex formulas to accomplish almost any task. And we will be using this approach to count words in Excel.

Now let’s go through the following steps to count text in Excel!

Let’s Count cells that are not blank

Calculate Results in Excel


Step 1: We need to count a total number of cells which are not blank in the range of B2:E6.

to type formula for counting total present of students

Step 2: We are going to use cell B8 to type formula for counting total present of students. As we want to count it from the range of B2:E6, So type this formula in cell B8:


Now press ENTER. The result is showing 17. So our counting is done!
In this way we can count more than one range cells using Comma separated ranges inside COUNTA function.
Read More: How to unlock scroll lock in Excel?

Tips: If we need to count from two different ranges like above picture, just change the formula like given below:


In this way, we can count more than one range cells using Comma separated ranges inside COUNTA function.

How to count the total number of words in a cell

How to count the total number of words in a cell

Now we will learn how to count the total number of word in a particular cell using LEN, SUBSTITUTE and TRIM functions

Step 3: Create another Sheet and Input a sentence in Cell A1 like above picture. To count words in cell A1, use this formula in cell B1:

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

Now press ENTER. It is showing the result 7. So there are 7 words in cell A1.

Remember: How this word counting formula works?


First, we use the SUBSTITUTE function to remove all spaces in the cell A1 by replacing them with an empty text string (“”) for the LEN function to return the length of the string without spaces:


After that, we subtract the string length without spaces from the total length of the string and add 1 to the final word count, since the number of words in a cell equals to the number of spaces plus 1.

Additionally, we use the TRIM function to eliminate extra spaces in the cell, if any. Sometimes a worksheet may contain a lot of invisible spaces, for example, two or more spaces between words or space characters accidentally typed at the beginning or end of the text (i.e. leading and trailing spaces). All those extra spaces can throw your word count off. To guard against this, before calculating the total length of the string, we use the TRIM function to remove all excess spaces except for single spaces between words.

So, now we have learned how to count text in Excel! Enjoy Excel!

Related Tutorials

Delete Duplicate in Excel or Remove Duplicate in Excel
November 9, 2018
Excel Formulas PDF
September 6, 2018
How To Lock Cells in Excel | Unprotect Excel
August 13, 2018
4x Faster at Excel
August 6, 2018
Separate Content of One Excel Cells into Separate Columns
August 3, 2018
How to Transpose Excel Columns to Rows | Paste Special Method
July 26, 2018
How to create sparklines in Excel
July 19, 2018
AutoSum in Excel with Shortcut
July 17, 2018
OFFSET Function in Excel
July 6, 2018
Strikethrough Shortcut in Excel & Word
July 4, 2018
INDIRECT Function with SUM, MAX, MIN & Independent Cell Value
June 29, 2018
Pivot Table Slicers In Excel
June 12, 2018
How to Split Cells in Excel using Text to Column
June 7, 2018
How to Wrap Text in Excel Automatically and Manually
June 6, 2018
How to Hide/Unhide Column in Excel
June 5, 2018
Highlight row based on cell value
June 4, 2018
Learn how to remove blank cells in Excel
June 3, 2018
How to Group Numbers, Dates & Text in Pivot table in Excel
June 1, 2018
5 Powerful Tricks to Format cells in Excel
May 31, 2018
Insert a Picture into a Cell in Excel
May 25, 2018
What is ISFORMULA Function and FORMULATEXT Function
May 21, 2018
How to Use SUBSTITUTE Function
May 21, 2018
Excel Quartile Function in Excel
May 8, 2018
How to use the Excel PERCENTILE function
May 7, 2018
Insert or Type degree symbol in Excel with Autocorrect Feature
May 7, 2018
25% Discount
No prize
All Courses at $200
10% Discount
Free Ebook
No Prize
No luck today
50% Discount
No prize
80% Discount
Get a chance to boost your knowledge!
Use this coupon code for any course that you wish for. 
Our in-house rules:
  • You can choose any course & redeem coupon
  • If you find any difficulty, mail us on [email protected]
  • Wheel Spin will end soon
  • Coupon code can be applied within 2 days.