how to count the number of commas, ampisands, etc in a single cell

palaeontology

Active Member
Joined
May 12, 2017
Messages
444
Office Version
  1. 2016
Platform
  1. Windows
Hi, I'm playing around with len(substitute...) etc to find a way to count the total number of the following symbols or words in a single cell ...

commas
ampisands ... ie: &
plus
lower case x
upper case X
the word .. featuring
the word feats
the word feat

as it's more than 7 things I'm looking for, I can't do a string of nested ifs.

Is there a way to count these items in a single cell ?

Kind regards,

Chris
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
To count comma or & :

varios 29feb2020.xlsm
AB
1
2Hi, I'm playing around, etc to find a way to count the total number of the ,3
3data & data & other2
Hoja5
Cell Formulas
RangeFormula
B2B2=LEN(A2)-LEN(SUBSTITUTE(A2,",",""))
B3B3=LEN(A3)-LEN(SUBSTITUTE(A3,"&",""))
 
Upvote 0
Hi Dante, thankyou for putting that together, that's actually what I already was using, but had hoped to make a single formula that looks for 8 or more particular symbols or words in the cell, but it looks like I might have to just write a single formula per symbol that I'm looking for.

On a different, but related note, is there a way (maybe using indirect) to count the number of times the symbol in let's say cell B1, appears in the cell A2 ... so instead of typing the comma into the old text part of the substitute formula, it refers to the comma symbol that sits in B1 ... that way I can change the symbol in B1 (when I want to) to an different symbol and the formula counts the number of times that newly typed symbol appears in A2.
 
Upvote 0
Try

varios 29feb2020.xlsm
AB
1&
2data & data & other2
Hoja5
Cell Formulas
RangeFormula
B2B2=LEN(A2)-LEN(SUBSTITUTE(A2,B1,""))
 
Upvote 0
but had hoped to make a single formula that looks for 8 or more particular symbols or words in the cell, but it looks like I might have to just write a single formula per symbol that I'm looking for.
You can give an example of what you have and the result or results that you need.
 
Upvote 0

Forum statistics

Threads
1,215,013
Messages
6,122,694
Members
449,092
Latest member
snoom82

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