A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Count the words in a cell



 
 
Thread Tools Display Modes
  #1  
Old May 20th, 2010, 06:22 PM posted to microsoft.public.excel.worksheet.functions
Elton Law[_2_]
external usenet poster
 
Posts: 94
Default Count the words in a cell

Dear exper
A cell contains a lot of information.
Is it possible to count certan word in a cell please?

Say A1 contains a series of text ....

1. Daily Swing even though Sto is hit high or low
2. Look at Chart pattern
3. Stop at dangerous level

How can I count number of "O" in the cell A1 please?

Thanks
Elton
  #2  
Old May 20th, 2010, 06:30 PM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default Count the words in a cell

Try this...

=LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),UPPER("O"),""))

Note that SUBSTITUTE is case sensitive.

--
Biff
Microsoft Excel MVP


"Elton Law" wrote in message
...
Dear exper
A cell contains a lot of information.
Is it possible to count certan word in a cell please?

Say A1 contains a series of text ....

1. Daily Swing even though Sto is hit high or low
2. Look at Chart pattern
3. Stop at dangerous level

How can I count number of "O" in the cell A1 please?

Thanks
Elton



  #3  
Old May 20th, 2010, 06:33 PM posted to microsoft.public.excel.worksheet.functions
Tom Hutchins
external usenet poster
 
Posts: 722
Default Count the words in a cell

=LEN(A1)-LEN(SUBSTITUTE(A1,"o",""))

It's case sensitive, so if you all "O" or "o", repeat the whole formula
substituting the other case and add the two results:
=(LEN(A1)-LEN(SUBSTITUTE(A1,"o","")))+(LEN(A1)-LEN(SUBSTITUTE(A1,"O","")))

Hope this helps,

Hutch

"Elton Law" wrote:

Dear exper
A cell contains a lot of information.
Is it possible to count certan word in a cell please?

Say A1 contains a series of text ....

1. Daily Swing even though Sto is hit high or low
2. Look at Chart pattern
3. Stop at dangerous level

How can I count number of "O" in the cell A1 please?

Thanks
Elton

  #4  
Old May 20th, 2010, 06:34 PM posted to microsoft.public.excel.worksheet.functions
Lars-Åke Aspelin[_4_]
external usenet poster
 
Posts: 74
Default Count the words in a cell

On Thu, 20 May 2010 10:22:01 -0700, Elton Law
wrote:

Dear exper
A cell contains a lot of information.
Is it possible to count certan word in a cell please?

Say A1 contains a series of text ....

1. Daily Swing even though Sto is hit high or low
2. Look at Chart pattern
3. Stop at dangerous level

How can I count number of "O" in the cell A1 please?

Thanks
Elton



Try the following formula:

=SUMPRODUCT(--(MID(A1,ROW(1:999),1)="o"))

The 999 in the formula should be any number not less than the number
of characters in the text.
With the given example text, the returned value is 8.

Hope this helps / Lars-Åke
  #5  
Old May 20th, 2010, 07:24 PM posted to microsoft.public.excel.worksheet.functions
Bernd P
external usenet poster
 
Posts: 613
Default Count the words in a cell

On 20 Mai, 18:30, "T. Valko" wrote:
Try this...

=LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),UPPER("O"),""))

Note that SUBSTITUTE is case sensitive.

--
Biff
Microsoft Excel MVP

"Elton Law" wrote in message

...

Dear exper
A cell contains a lot of information.
Is it possible to count certan word in a cell please?


Say A1 contains a series of text ....


1. Daily Swing even though Sto is hit high or low
2. Look at Chart pattern
3. Stop at dangerous level


How can I count number of "O" in the cell A1 please?


Thanks
Elton


Hi Biff,

I like that UPPER("O") part :-)

Have fun,
Bernd
  #6  
Old May 20th, 2010, 08:38 PM posted to microsoft.public.excel.worksheet.functions
Lars-Åke Aspelin[_4_]
external usenet poster
 
Posts: 74
Default Count the words in a cell

On Thu, 20 May 2010 11:24:51 -0700 (PDT), Bernd P
wrote:

On 20 Mai, 18:30, "T. Valko" wrote:
Try this...

=LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),UPPER("O"),""))

Note that SUBSTITUTE is case sensitive.

--
Biff
Microsoft Excel MVP

"Elton Law" wrote in message

...

Dear exper
A cell contains a lot of information.
Is it possible to count certan word in a cell please?


Say A1 contains a series of text ....


1. Daily Swing even though Sto is hit high or low
2. Look at Chart pattern
3. Stop at dangerous level


How can I count number of "O" in the cell A1 please?


Thanks
Elton


Hi Biff,

I like that UPPER("O") part :-)

Have fun,
Bernd


To be really sure, make it TRIM(LEFT(UPPER("O"))) :-)

Lars-Åke

  #7  
Old May 20th, 2010, 09:18 PM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default Count the words in a cell

I like that UPPER("O") part

So then you know why it's there?

--
Biff
Microsoft Excel MVP


"Bernd P" wrote in message
...
On 20 Mai, 18:30, "T. Valko" wrote:
Try this...

=LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),UPPER("O"),""))

Note that SUBSTITUTE is case sensitive.

--
Biff
Microsoft Excel MVP

"Elton Law" wrote in message

...

Dear exper
A cell contains a lot of information.
Is it possible to count certan word in a cell please?


Say A1 contains a series of text ....


1. Daily Swing even though Sto is hit high or low
2. Look at Chart pattern
3. Stop at dangerous level


How can I count number of "O" in the cell A1 please?


Thanks
Elton


Hi Biff,

I like that UPPER("O") part :-)

Have fun,
Bernd



  #8  
Old May 20th, 2010, 09:36 PM posted to microsoft.public.excel.worksheet.functions
Bernd P
external usenet poster
 
Posts: 613
Default Count the words in a cell

On 20 Mai, 20:38, Lars-Åke Aspelin wrote:
On Thu, 20 May 2010 11:24:51 -0700 (PDT), Bernd P



wrote:
On 20 Mai, 18:30, "T. Valko" wrote:
Try this...


=LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),UPPER("O"),""))


Note that SUBSTITUTE is case sensitive.


--
Biff
Microsoft Excel MVP


"Elton Law" wrote in message


...


Dear exper
A cell contains a lot of information.
Is it possible to count certan word in a cell please?


Say A1 contains a series of text ....


1. Daily Swing even though Sto is hit high or low
2. Look at Chart pattern
3. Stop at dangerous level


How can I count number of "O" in the cell A1 please?


Thanks
Elton


Hi Biff,


I like that UPPER("O") part :-)


Have fun,
Bernd


To be really sure, make it TRIM(LEFT(UPPER("O"))) *:-)

Lars-Åke


Takk, Lars!

:-)

Regards,
Bernd
  #9  
Old May 20th, 2010, 09:54 PM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default Count the words in a cell

To be really sure, make it TRIM(LEFT(UPPER("O")))

To be really super-duper extra sure you might want to use:

CLEAN(TRIM(PROPER(LEFT(UPPER(CHAR(79)),1))))

--
Biff
Microsoft Excel MVP


"Lars-Åke Aspelin" wrote in message
news
On Thu, 20 May 2010 11:24:51 -0700 (PDT), Bernd P
wrote:

On 20 Mai, 18:30, "T. Valko" wrote:
Try this...

=LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),UPPER("O"),""))

Note that SUBSTITUTE is case sensitive.

--
Biff
Microsoft Excel MVP

"Elton Law" wrote in message

...

Dear exper
A cell contains a lot of information.
Is it possible to count certan word in a cell please?

Say A1 contains a series of text ....

1. Daily Swing even though Sto is hit high or low
2. Look at Chart pattern
3. Stop at dangerous level

How can I count number of "O" in the cell A1 please?

Thanks
Elton


Hi Biff,

I like that UPPER("O") part :-)

Have fun,
Bernd


To be really sure, make it TRIM(LEFT(UPPER("O"))) :-)

Lars-Åke



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:12 PM.


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