Counting specific letters in multiple cells

T

tohlz

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
 
A

Andy Pope

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
 

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