PC Review


Reply
Thread Tools Rate Thread

Counting specific letters in multiple cells

 
 
tohlz
Guest
Posts: n/a
 
      4th Jul 2008
Hi,
Lets say I want to look for the letter "O" in a cell with the text "How are
you?" and count the number of "O" in that particular cell, the formula would
be something like:
=LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),"O",""))

and the result for "How are you?" will return 2.

My question is, what if I want to do it for multiple cells? For instance,
from Cell A1 to A10. Thanks in advance.
--
Shawn Toh (tohlz)
Microsoft MVP PowerPoint

(Amazing PowerPoint animations, artworks, games here)
http://pptheaven.mvps.org
PowerPoint Heaven - The Power to Animate
 
Reply With Quote
 
 
 
 
Andy Pope
Guest
Posts: n/a
 
      4th Jul 2008
Hi,

you could use an array formula. Use CTRL+SHIFT+ENTER to commit the formula
rather than the usual ENTER.

=SUM(LEN(A1:A10)-LEN(SUBSTITUTE(UPPER(A1:A10),"O","")))

Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"tohlz" <pptheaven[AT]gmail[DOT]com> wrote in message
news:875FF5DA-72FA-450E-B8D2-(E-Mail Removed)...
> Hi,
> Lets say I want to look for the letter "O" in a cell with the text "How
> are
> you?" and count the number of "O" in that particular cell, the formula
> would
> be something like:
> =LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),"O",""))
>
> and the result for "How are you?" will return 2.
>
> My question is, what if I want to do it for multiple cells? For instance,
> from Cell A1 to A10. Thanks in advance.
> --
> Shawn Toh (tohlz)
> Microsoft MVP PowerPoint
>
> (Amazing PowerPoint animations, artworks, games here)
> http://pptheaven.mvps.org
> PowerPoint Heaven - The Power to Animate


 
Reply With Quote
 
Mike H
Guest
Posts: n/a
 
      4th Jul 2008
Try

=SUMPRODUCT(LEN(A1:A10)-LEN(SUBSTITUTE(UPPER(A1:A10),"O","")))

Mike

"tohlz" wrote:

> Hi,
> Lets say I want to look for the letter "O" in a cell with the text "How are
> you?" and count the number of "O" in that particular cell, the formula would
> be something like:
> =LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),"O",""))
>
> and the result for "How are you?" will return 2.
>
> My question is, what if I want to do it for multiple cells? For instance,
> from Cell A1 to A10. Thanks in advance.
> --
> Shawn Toh (tohlz)
> Microsoft MVP PowerPoint
>
> (Amazing PowerPoint animations, artworks, games here)
> http://pptheaven.mvps.org
> PowerPoint Heaven - The Power to Animate

 
Reply With Quote
 
tohlz
Guest
Posts: n/a
 
      4th Jul 2008
Thanks for the help, Andy and Mike.
--
Shawn Toh (tohlz)
Microsoft MVP PowerPoint

(Amazing PowerPoint animations, artworks, games here)
http://pptheaven.mvps.org
PowerPoint Heaven - The Power to Animate


"Mike H" wrote:

> Try
>
> =SUMPRODUCT(LEN(A1:A10)-LEN(SUBSTITUTE(UPPER(A1:A10),"O","")))
>
> Mike
>
> "tohlz" wrote:
>
> > Hi,
> > Lets say I want to look for the letter "O" in a cell with the text "How are
> > you?" and count the number of "O" in that particular cell, the formula would
> > be something like:
> > =LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),"O",""))
> >
> > and the result for "How are you?" will return 2.
> >
> > My question is, what if I want to do it for multiple cells? For instance,
> > from Cell A1 to A10. Thanks in advance.
> > --
> > Shawn Toh (tohlz)
> > Microsoft MVP PowerPoint
> >
> > (Amazing PowerPoint animations, artworks, games here)
> > http://pptheaven.mvps.org
> > PowerPoint Heaven - The Power to Animate

 
Reply With Quote
 
Mike H
Guest
Posts: n/a
 
      4th Jul 2008
Glad I could help and thanks for the feedback.

"tohlz" wrote:

> Thanks for the help, Andy and Mike.
> --
> Shawn Toh (tohlz)
> Microsoft MVP PowerPoint
>
> (Amazing PowerPoint animations, artworks, games here)
> http://pptheaven.mvps.org
> PowerPoint Heaven - The Power to Animate
>
>
> "Mike H" wrote:
>
> > Try
> >
> > =SUMPRODUCT(LEN(A1:A10)-LEN(SUBSTITUTE(UPPER(A1:A10),"O","")))
> >
> > Mike
> >
> > "tohlz" wrote:
> >
> > > Hi,
> > > Lets say I want to look for the letter "O" in a cell with the text "How are
> > > you?" and count the number of "O" in that particular cell, the formula would
> > > be something like:
> > > =LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),"O",""))
> > >
> > > and the result for "How are you?" will return 2.
> > >
> > > My question is, what if I want to do it for multiple cells? For instance,
> > > from Cell A1 to A10. Thanks in advance.
> > > --
> > > Shawn Toh (tohlz)
> > > Microsoft MVP PowerPoint
> > >
> > > (Amazing PowerPoint animations, artworks, games here)
> > > http://pptheaven.mvps.org
> > > PowerPoint Heaven - The Power to Animate

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
counting colords cells with letters in them JJ Microsoft Excel Worksheet Functions 6 4th Dec 2008 09:07 AM
Counting specific letters in a cell Sandy Microsoft Excel Worksheet Functions 3 3rd Jul 2008 04:58 PM
How to count specific letters in range of cells? =?Utf-8?B?UmVuZWUgUi4=?= Microsoft Excel Misc 3 22nd Jun 2007 08:14 PM
counting specific figures in cells dependant upon contents of adjacent cells judoist Microsoft Excel Discussion 2 15th Jun 2004 02:45 PM
counting specific cells Norm Microsoft Excel Worksheet Functions 2 3rd Nov 2003 12:01 AM


Features
 

Advertising
 

Newsgroups
 


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