View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default count no. of times a character occurs in a cell

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

--
Gary''s Student - gsnu200840


"hsg" wrote:

Is there any function which can tell how many characters (commas) are there
in a cell?

example: if I enter [12,13,15,16] in a cell, I would like to know how many
entries
have been made in that cell, each separated by a comma.
I figure from the data that no. of entries shall be no. of commas plus ONE,
i.e. in above case three commas mean 4 separate numbers.

Can this be done with a simple function? because if A1 has above entry, B1
should
tell how many numbers have been entered in A1.
Similer entries will exist in column A (i.e. A2, A3 etc...) and then
whenever such an
entry is made, B2, B3 etc... should automatically tell how many entries are
there
in these cells.

Pl help