counting number of word in a cell

K

kokhong

is there a function can count number of word in a cell

example:

A B
username count
kok, hong, Lee
chan, NG
Ti, Lee

after counting
A B
username count
kok, hong, Lee 3
chan, NG 2
Ti, Lee 2
 
T

T. Valko

You can count the number of spaces in the cell then add 1:

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

kokhong

this problem i have settled..this can be found form MIscrosoft help..
the function is :
=IF(LEN(TRIM(A1))=0,0,LEN(TRIM(A1))-LEN(SUBSTITUTE(A1," ",""))+1)
 
×

מיכ×ל (מיקי) ×בידן

Using Trim is a very good idea because, accidently, there might have been
typed more than one space between two words.
Micky
 
D

Dave Peterson

One more that will work ok if the cell is empty:

If the words are separated by spaces:
=LEN(TRIM(A1))-LEN(SUBSTITUTE(TRIM(A1)," ",""))+(TRIM(A1)<>"")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top