Count iterations of a letter excluding other characters

jl2509

Board Regular
Joined
Oct 30, 2015
Messages
198
Office Version
  1. 365
Platform
  1. Windows
Hi all,

In column A, I have codes allocated as the letter A and B for up to 5 iterations per cell (but could be more I guess dependent on growth). These are separated by "/" but I dont want to count this

How do I count the number of iterations the letters are used in the column starting from Cell A10: A110

The count in Cell A3 should be the total number of "A" in Cell A4 the total Number of "B" and in Cell A5 the sum total of "A" and "B"

i.e. in Column A

Cell A3 Count for "A": 26
Cell A4 Count for "B": 27
Cell A5 sum of "A" and "B": 33

A
A/A
A/A/A
A/A/A/A
B
B/B
B/B/B
B/B/B/B
A/B
A/B/B
A/B/B/B
A/B/B/B/B
B/A
B/A/A
B/A/A/A
B/A/A/A/A
B/B/A/A/B

etc

Thanks in advance.
 
You need to use upper, rather than proper
Excel Formula:
="A=" & SUMPRODUCT(LEN(A10:A100) - LEN(SUBSTITUTE(UPPER(A10:A100), "A", "")))
 
Upvote 0
Solution

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Just to make sure I have all the cases here, if you have A/bb then you get a count of 1 x "A" and 1 x "B"
b/aa/bb/a/b/bb gives a count of 2 x "a" and 4 x "b"
 
Upvote 0
By Jove I think that's it. Thanks for all the support folks.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
This seems to cater for that

="A=" & SUMPRODUCT(LEN(A1:A21) - LEN(SUBSTITUTE(UPPER(A1:A21), "A", "")))
 
Upvote 0
Just to make sure I have all the cases here, if you have A/bb then you get a count of 1 x "A" and 1 x "B"
b/aa/bb/a/b/bb gives a count of 2 x "a" and 4 x "b"

By Jove I think that's it.
:huh: Those two quotes don't seem to match to me. As far as I can see none of the formulas suggested give the results in the first quote.
As I read it, combining those two examples the results would be A=3 and B=5. If that was the requirement then perhaps this?

24 02 26.xlsm
A
3A=3
4B=5
5
6
7
8
9
10A/bb
11b/aa/bb/a/b/bb
12
Count
Cell Formulas
RangeFormula
A3A3=LET(t,"/"&TEXTJOIN("/",1,A10:A100),s,SEQUENCE(LEN(t)-1),c,MID(t,s+1,1),"A="&SUM((c="A")*(c<>MID(t,s,1))))
A4A4=LET(t,"/"&TEXTJOIN("/",1,A10:A100),s,SEQUENCE(LEN(t)-1),c,MID(t,s+1,1),"B="&SUM((c="B")*(c<>MID(t,s,1))))
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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