Excel formula


Posted by Terri on January 04, 2002 1:57 PM

I need the formula for counting within a range of cell the number of As. Then I need to copy the formula and count the Bs and do it again for C. Then I need to get the % of each. Can you tell me the formula I need to use?

Posted by Aladin Akyurek on January 04, 2002 2:28 PM

Terri --

=LEN($A$2)-LEN(SUBSTITUTE(LOWER($A$2),LOWER(B$1),""))

where A2 houses the first string entry, B1 the letter A, C1 the letter B, and C1 the letter C.

Copy this formula across till C1 then down as far as needed.

As to percentage, give an example, because it's unclear whether you want, e.g.,

number of A's/length of the string

or

number of A's/(number of A's + number of B's + number of C's.

Aladin



Posted by Aladin Akyurek on January 04, 2002 2:31 PM

The formula should be:

=LEN($A2)-LEN(SUBSTITUTE(LOWER($A2),LOWER(B$1),""))

=======