You could do that but if you know the letter needs to be in uppercase why
use UPPER("r") when you can just use "R"?
To make it foolproof it would be better to use a cell to hold the letter
then:
=LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),UPPER(A2),""))
Where A2 = R or r
--
Biff
Microsoft Excel MVP
"Tevuna" <(E-Mail Removed)> wrote in message
news:F3064E1D-CB5E-4A4C-9301-(E-Mail Removed)...
> To solve for its being case sensitive, use UPPER at both
> =LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),UPPER("r"),""))
>
> "T. Valko" wrote:
>
>> Try this:
>>
>> =LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),"R",""))
>>
>> Note: SUBSTITUTE is case sensitive so the "R" needs to be in uppercase.
>>
>> =LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),"R","")) = 5
>> =LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),"r","")) = 0
>>
>> --
>> Biff
>> Microsoft Excel MVP
>>
>>
>> "Eric" <(E-Mail Removed)> wrote in message
>> news:C27F7DB2-E79E-4A86-8960-(E-Mail Removed)...
>> > Does anyone have any suggestions on how to count the match letter
>> > within
>> > string?
>> > such as "RRRRR" in cell A1, then return the number of "R" in cell B1,
>> > which
>> > is 5.
>> > Does anyone have any suggestions?
>> > Eric
>>
>>
>>
|