ExcelBanter

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

hsg

counting no. of times a character occurs in a cell
 
Can a function tell the number of times a particular character is occuring in
a text string in a particular cell?

A1 contains ABCD,ACDT,AKBL,BCDF,PIZQ

I would like to count no. of "commas" appearing (",") in this cell.

hellp appreciated, thanks

hsg

Mike H

counting no. of times a character occurs in a cell
 
Try

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

Mike


"hsg" wrote:

Can a function tell the number of times a particular character is occuring in
a text string in a particular cell?

A1 contains ABCD,ACDT,AKBL,BCDF,PIZQ

I would like to count no. of "commas" appearing (",") in this cell.

hellp appreciated, thanks

hsg


Bob Bridges[_2_]

counting no. of times a character occurs in a cell
 
VERY slick! I wouldn't have thought of that one.

--- "Mike H" wrote:
=LEN(A1)-LEN(SUBSTITUTE(A1,",",""))


hsg

count no. of commas in a cell
 
excellent!
Never figured it out that way!

Thanks Mike, Gary's student, Ashish




All times are GMT +1. The time now is 03:50 AM.

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