PC Review


Reply
Thread Tools Rate Thread

Counting Characters In A String

 
 
fabio
Guest
Posts: n/a
 
      29th Apr 2010
Hi

I am trying to manipulate some data strings and I want to count how many
times the characters '(' and ')' occur in each of the data strings on my
spreadsheet. I have tried some simple options but am unable to achieve the
result I want.

I would be very grateful if anyone is able to provide me with a method of
doing this.

Thanks
 
Reply With Quote
 
 
 
 
Jacob Skaria
Guest
Posts: n/a
 
      29th Apr 2010
To count from a data string which is in cell A1 use the below

=LEN(A1)-LEN(SUBSTITUTE(SUBSTITUTE(A1,"(",),")",))

To count all in a spreadsheet use the Find Dialog box and enter "(" and hit
FindAll which will list all the occurences and give a count at the bottom.
Make sure you select the option appropriately to avoid looking at
formulas....(If thats is your requirement)

--
Jacob (MVP - Excel)


"fabio" wrote:

> Hi
>
> I am trying to manipulate some data strings and I want to count how many
> times the characters '(' and ')' occur in each of the data strings on my
> spreadsheet. I have tried some simple options but am unable to achieve the
> result I want.
>
> I would be very grateful if anyone is able to provide me with a method of
> doing this.
>
> Thanks

 
Reply With Quote
 
fabio
Guest
Posts: n/a
 
      29th Apr 2010
Thank you Jacob. That worked fine as I did want it on a cell by cell basis.

"Jacob Skaria" wrote:

> To count from a data string which is in cell A1 use the below
>
> =LEN(A1)-LEN(SUBSTITUTE(SUBSTITUTE(A1,"(",),")",))
>
> To count all in a spreadsheet use the Find Dialog box and enter "(" and hit
> FindAll which will list all the occurences and give a count at the bottom.
> Make sure you select the option appropriately to avoid looking at
> formulas....(If thats is your requirement)
>
> --
> Jacob (MVP - Excel)
>
>
> "fabio" wrote:
>
> > Hi
> >
> > I am trying to manipulate some data strings and I want to count how many
> > times the characters '(' and ')' occur in each of the data strings on my
> > spreadsheet. I have tried some simple options but am unable to achieve the
> > result I want.
> >
> > I would be very grateful if anyone is able to provide me with a method of
> > doing this.
> >
> > Thanks

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Leading Characters If String Is Only 7 Characters Paperback Writer Microsoft Excel Misc 1 21st Apr 2009 08:47 PM
Counting the number of bytes used by characters of a String Nicolas Microsoft C# .NET 6 12th Dec 2004 09:23 PM
Counting characters in a string =?Utf-8?B?Y2I=?= Microsoft Access Form Coding 2 19th May 2004 11:19 PM
Counting Characters in a string Les Microsoft Access Form Coding 9 19th May 2004 04:52 AM
Adding characters to a string : Error 'string.this[int]' cannot be assigned to -- it is read only J. Oliver Microsoft C# .NET 4 29th Sep 2003 07:16 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:07 PM.