Counting the number of times a character appears in a cell

  • Thread starter Thread starter Gary Thomson
  • Start date Start date
G

Gary Thomson

hi,

How do I count the number of times a specific character
appears in a cell (assuming it is there is the first
place)?

I.e. In cell A1 I have

aaabbccccccc

and if I have "a", "b" and "c" in cells B1, B2 and B3, I
want to show 3, 2 and 7 in cells C1, C2 and C3
respectively.

What function do I use to do this? The function I need to
use also needs to be nested within another function, so I
cant use VBA code.

Many Thanks

Gary.
 
Enter this in C1, and copy down to C3:

=LEN($A$1)-LEN(SUBSTITUTE($A$1,B1,""))
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


hi,

How do I count the number of times a specific character
appears in a cell (assuming it is there is the first
place)?

I.e. In cell A1 I have

aaabbccccccc

and if I have "a", "b" and "c" in cells B1, B2 and B3, I
want to show 3, 2 and 7 in cells C1, C2 and C3
respectively.

What function do I use to do this? The function I need to
use also needs to be nested within another function, so I
cant use VBA code.

Many Thanks

Gary.
 
Back
Top