Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 25
Default Count values between commas

I need to be able to count how many entries are separated by commas. For
instance, in cell A2, I have:
AB1, AB2, AB3, AB4.
In cell B2, I want to display the number 4 because there are 4 values.

So if I have
AXX2, Ax3, A3TU0
In cell B2, I want to display the number 3 because there are 3 values.

Is there a way to do this?

Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 698
Default Count values between commas

Try something like this:

=LEN(B2)-LEN(SUBSTITUTE(B2,",",""))+1


Does that help?
***********
Regards,
Ron

XL2002, WinXP


"jhicsupt" wrote:

I need to be able to count how many entries are separated by commas. For
instance, in cell A2, I have:
AB1, AB2, AB3, AB4.
In cell B2, I want to display the number 4 because there are 4 values.

So if I have
AXX2, Ax3, A3TU0
In cell B2, I want to display the number 3 because there are 3 values.

Is there a way to do this?

Thanks in advance.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 144
Default Count values between commas

B2 should be A2 ?


"Ron Coderre" schreef in bericht
...
Try something like this:

=LEN(B2)-LEN(SUBSTITUTE(B2,",",""))+1


Does that help?
***********
Regards,
Ron

XL2002, WinXP


"jhicsupt" wrote:

I need to be able to count how many entries are separated by commas. For
instance, in cell A2, I have:
AB1, AB2, AB3, AB4.
In cell B2, I want to display the number 4 because there are 4 values.

So if I have
AXX2, Ax3, A3TU0
In cell B2, I want to display the number 3 because there are 3 values.

Is there a way to do this?

Thanks in advance.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 698
Default Count values between commas

Yes....In my testing I evidently transposed A2 and B2.

Thanks for catching that.


***********
Regards,
Ron

XL2002, WinXP


"Jack Sons" wrote:

B2 should be A2 ?


"Ron Coderre" schreef in bericht
...
Try something like this:

=LEN(B2)-LEN(SUBSTITUTE(B2,",",""))+1


Does that help?
***********
Regards,
Ron

XL2002, WinXP


"jhicsupt" wrote:

I need to be able to count how many entries are separated by commas. For
instance, in cell A2, I have:
AB1, AB2, AB3, AB4.
In cell B2, I want to display the number 4 because there are 4 values.

So if I have
AXX2, Ax3, A3TU0
In cell B2, I want to display the number 3 because there are 3 values.

Is there a way to do this?

Thanks in advance.




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Count values between commas

A minor variation of Ron's suggestion:

=LEN(A2)-LEN(SUBSTITUTE(A2,",",""))+(A2<"")

It may handle empty cells better.

jhicsupt wrote:

I need to be able to count how many entries are separated by commas. For
instance, in cell A2, I have:
AB1, AB2, AB3, AB4.
In cell B2, I want to display the number 4 because there are 4 values.

So if I have
AXX2, Ax3, A3TU0
In cell B2, I want to display the number 3 because there are 3 values.

Is there a way to do this?

Thanks in advance.


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count Commas in Cells Dax Arroway Excel Discussion (Misc queries) 5 January 30th 07 08:22 PM
Count Intervals of 2 Consecutive Values in same Row and Return Count across Row Sam via OfficeKB.com Excel Worksheet Functions 6 November 29th 05 03:27 PM
Count Intervals of 2 Numeric values in same Row and Return Count across Row Sam via OfficeKB.com Excel Worksheet Functions 12 September 24th 05 10:58 PM
Count unique values and create list based on these values vipa2000 Excel Worksheet Functions 7 August 5th 05 01:17 AM
Count Intervals of Filtered TEXT values in Column and Return Count across a Row Sam via OfficeKB.com Excel Worksheet Functions 9 July 31st 05 03:37 AM


All times are GMT +1. The time now is 05:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"