Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default counting number of word in a cell

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default counting number of word in a cell

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

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

--
Biff
Microsoft Excel MVP


"kokhong" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default counting number of word in a cell

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)

"kokhong" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 561
Default counting number of word in a cell

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


"kokhong" wrote:

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)

"kokhong" wrote:

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

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default counting number of word in a cell

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)<"")

kokhong wrote:

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


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting number of occurances of a word Chris the researcher Excel Worksheet Functions 5 June 23rd 09 08:49 PM
Code for counting number of word strings? Maria Excel Discussion (Misc queries) 3 June 19th 09 04:11 PM
Counting number of times a specific word appears in a single cell Ken Curtis Excel Discussion (Misc queries) 19 June 16th 09 05:34 AM
counting the number of times a word appears Adrienne[_2_] Excel Worksheet Functions 5 September 5th 07 02:49 AM
Counting the number of times a word appears in a worksheet Jig Bhakta Excel Worksheet Functions 4 February 3rd 05 03:01 AM


All times are GMT +1. The time now is 06:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"