Count given characters in cell value

CsJHUN

Active Member
Joined
Jan 13, 2015
Messages
360
Office Version
  1. 365
  2. 2021
  3. 2019
Platform
  1. Windows
  2. Mobile
Hi guys,

i would like to get a help from you. I need a formula, macro whatever for this table:

resultSABC
P1AACCCACAABSA
P2AAACABCBA
P3ASCAAABCABCS
P4BCBSABBA
P5BBCSAACA
P6SSBSCBACACBB
P7SSACCSBSBSSB
P8AASSCCBCBB
P9SCBBCSCBCSCB
P10SSBBASBCCSSC

<colgroup><col><col><col span="4"></colgroup><tbody>
</tbody>
I would like to count how many S and A and B and C in the cell on column B(result)
Any ideas welcome :)
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
in C2 put
=LEN($B2)-LEN(SUBSTITUTE($B2,C$1,""))
and copy across and down

Substitute is case sensitive
=LEN($B2)-LEN(SUBSTITUTE(UPPER($B2),C$1,""))
so you can convert all to upper case
 
Last edited:
Upvote 0
TY, works as charm
really nice thinking, absolutely love it
 
Upvote 0

Forum statistics

Threads
1,215,522
Messages
6,125,312
Members
449,218
Latest member
Excel Master

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