PC Review
Forums
Newsgroups
Microsoft Excel
Microsoft Excel Discussion
counting commas within a string
Forums
Newsgroups
Microsoft Excel
Microsoft Excel Discussion
counting commas within a string
![]() |
counting commas within a string |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi to All,
Cell A1 contains a text string such as 56,58,12,1,22,893 I want to determine how many numbers are contained within the string 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 |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Hi RonW
Length of string minus length of sting without commas: =LEN(A1)-LEN(SUBSTITUTE(A1,",","")) HTH. Best wishes Harald <Ron.Winkley@gmail.com> skrev i melding news:4efd29cb-6978-4e8c-80ef-fbfd6f1c7d9d@y21g2000hsf.googlegroups.com... > Hi to All, > > Cell A1 contains a text string such as 56,58,12,1,22,893 > I want to determine how many numbers are contained within the string > 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 |
|
|
|
#3 |
|
Guest
Posts: n/a
|
=LEN(E2)-LEN(SUBSTITUTE(E2,",",""))+1
with your data in E2 -- Gary''s Student - gsnu2007j "Ron.Winkley@gmail.com" wrote: > Hi to All, > > Cell A1 contains a text string such as 56,58,12,1,22,893 > I want to determine how many numbers are contained within the string > 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 > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
If you want to count the number of "elements" that are separated by commas:
=LEN(A1)-LEN(SUBSTITUTE(A1,",",""))+(A1<>"") Ron.Winkley@gmail.com wrote: > > Hi to All, > > Cell A1 contains a text string such as 56,58,12,1,22,893 > I want to determine how many numbers are contained within the string > 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 -- Dave Peterson |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

