Counting a number of certain Char in a certain field that are not in []

texasryder

New Member
Joined
May 18, 2011
Messages
4
ok here is my problem I'm doing reports for my company on Time cards and the submitted timecards are marked by S and then the name of the person that can accept the timecard. for instance in a cell I have

S [Sho, Sheng] S [Sho, Sheng/ Timecard approval] S [ so on and so forth]

now I can get how many s's but I'm needing 3 as my answer corisponding to the three S's that go before the []

your help would be appriciated

Thanks.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
ok here is my problem I'm doing reports for my company on Time cards and the submitted timecards are marked by S and then the name of the person that can accept the timecard. for instance in a cell I have

S [Sho, Sheng] S [Sho, Sheng/ Timecard approval] S [ so on and so forth]

now I can get how many s's but I'm needing 3 as my answer corisponding to the three S's that go before the []

your help would be appriciated

Thanks.
Maybe you can just count how many [ or ] there are.

=LEN(A2)-LEN(SUBSTITUTE(A2,"]",""))
 
Upvote 0
OK that helps thanks now I need to be able to extend it from a1 to I1. When I replace a1 with a1:i1 it just gives me a #VALUE!

how can I correct this

here is my current formula

=LEN(F10:J10)-LEN(SUBSTITUTE(F10:J10,"]",""))
 
Upvote 0
I think it might be because the fields F through H are blank

is there a way to get around this where I dont have to go in and do one cell at a time
 
Upvote 0
I think it might be because the fields F through H are blank

is there a way to get around this where I dont have to go in and do one cell at a time
Try it like this...

Book1
A
2S [...] S [...] S [...]
3_
4X []
5C [] B []
6H
7K [] N [] M [] T []
8_
9_
10_
Sheet1

There are 10 sets of brackets in the range. So, we'll count how many of the closing brackets ] there are.

=SUMPRODUCT(LEN(A2:A10)-LEN(SUBSTITUTE(A2:A10,"]","")))
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,730
Members
452,939
Latest member
WCrawford

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