View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
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