PC Review


Reply
Thread Tools Rate Thread

counting the number of commas within a text string

 
 
Ron.Winkley@gmail.com
Guest
Posts: n/a
 
      10th Jul 2008
Hi to All,

Cell A1 contains a text string such as 56, 58, 12, 1, 22, 893 or it
could
be 56,58,12,1,22,893

I want to determine how many values are contained within the string
[in this case only 6, but could be more] Simply, counting the
commas
and adding 1 one seems to be the easy answer?

How can I create an Excel formula to count the commas, or please
suggest an alternative method.

Thanks for your help,

Cheers,
RonW
 
Reply With Quote
 
 
 
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      10th Jul 2008
Try this...

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

Rick


<(E-Mail Removed)> wrote in message
news:6d78f2e8-60bd-4a88-9c3e-(E-Mail Removed)...
> Hi to All,
>
> Cell A1 contains a text string such as 56, 58, 12, 1, 22, 893 or it
> could
> be 56,58,12,1,22,893
>
> I want to determine how many values are contained within the string
> [in this case only 6, but could be more] Simply, counting the
> commas
> and adding 1 one seems to be the easy answer?
>
> How can I create an Excel formula to count the commas, or please
> suggest an alternative method.
>
> Thanks for your help,
>
> Cheers,
> RonW


 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      10th Jul 2008
Did you not read all the replies you got to this same question July 8th?

Here they are.......

http://tinyurl.com/6syoda


Gord Dibben MS Excel MVP

On Thu, 10 Jul 2008 11:54:58 -0700 (PDT), (E-Mail Removed) wrote:

>Hi to All,
>
>Cell A1 contains a text string such as 56, 58, 12, 1, 22, 893 or it
>could
>be 56,58,12,1,22,893
>
>I want to determine how many values are contained within the string
>[in this case only 6, but could be more] Simply, counting the
>commas
>and adding 1 one seems to be the easy answer?
>
>How can I create an Excel formula to count the commas, or please
>suggest an alternative method.
>
>Thanks for your help,
>
>Cheers,
>RonW


 
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
counting commas within a string Ron.Winkley@gmail.com Microsoft Excel Discussion 3 9th Jul 2008 01:12 AM
counting commas within a string Ron.Winkley@gmail.com Microsoft Excel Discussion 1 8th Jul 2008 11:15 PM
Commas in a string of text =?Utf-8?B?TXIuIFNtaWxleQ==?= Microsoft Access 0 26th Jul 2006 06:38 PM
Re: Code for counting commas in a text field? Katrina Microsoft Access VBA Modules 2 16th Jun 2004 10:12 PM
Code for counting commas in a text field? Chris Nebinger Microsoft Access VBA Modules 2 15th Jun 2004 07:28 PM


Features
 

Advertising
 

Newsgroups
 


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