ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Count the times a specific character appears in a cell (https://www.excelbanter.com/excel-worksheet-functions/214097-count-times-specific-character-appears-cell.html)

[email protected]

Count the times a specific character appears in a cell
 
I am trying to count the number of times a specific character appears
in a cell (or range of cells). Anyone know how to do this?

Example: The cell contains "Fruit/Meat/Fish" and I would like a
formula counting the number of times "/" appears (returning the value
2).

Brgds,
Harald

Mike H

Count the times a specific character appears in a cell
 
Try this


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

Mike

" wrote:

I am trying to count the number of times a specific character appears
in a cell (or range of cells). Anyone know how to do this?

Example: The cell contains "Fruit/Meat/Fish" and I would like a
formula counting the number of times "/" appears (returning the value
2).

Brgds,
Harald


Gary''s Student

Count the times a specific character appears in a cell
 
=-LEN(SUBSTITUTE(A1,"/",""))+LEN(A1)

--
Gary''s Student - gsnu2007k

[email protected]

Count the times a specific character appears in a cell
 
Brilliant. Thanks!


All times are GMT +1. The time now is 08:50 PM.

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