Count number of occurences of letter in cell and row

t11uyn

New Member
Joined
Dec 16, 2013
Messages
9
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]Amy[/TD]
[TD]Bob[/TD]
[TD]John[/TD]
[TD]Total[/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD]A,A,A[/TD]
[TD][/TD]
[TD]A,[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]Banana[/TD]
[TD]B,B[/TD]
[TD]B,B,B[/TD]
[TD]B,B[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]Lettuce[/TD]
[TD]L[/TD]
[TD]L,L,L[/TD]
[TD][/TD]
[TD]4[/TD]
[/TR]
</tbody>[/TABLE]


Hello,


I am looking to count the number of occurrences a letter appears in a row. This letter can also appear multiple times in a cell.

If I use the formula below it will count the single cell, but I am looking to total up the entire row so it gives the total like in my example
=LEN(B2)-LEN(SUBSTITUTE(B2,"s",""))

Also it is possible that one cell may have more than one type of letter. For example B3, could have B,B,B,T,T. But I would only want to count all the Bs.

Is there an easier way of doing this? Many thanks
 
Last edited:
I managed to figure this out. For anyone's reference I used the formula:

=SUMPRODUCT(LEN(range)-LEN(SUBSTITUTE(range,"B","")))
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top