ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   count no. of times a character occurs in a cell (https://www.excelbanter.com/excel-worksheet-functions/225164-count-no-times-character-occurs-cell.html)

hsg

count no. of times a character occurs in a cell
 
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

Gary''s Student

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


hsg

count commas in a cell
 
works exactly,
thank you Gary's student
and Ashish

hsg


All times are GMT +1. The time now is 11:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com