ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Counting Elements in a String (https://www.excelbanter.com/excel-worksheet-functions/8516-counting-elements-string.html)

carl

Counting Elements in a String
 
I have strings like these:

AB;CD;EF;GH;IJ

Is there an easy way to count the number of elements in the string. In this
case the count would be 5.

Thank you in advance.

Frank Kabel

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

--
Regards
Frank Kabel
Frankfurt, Germany

carl wrote:
I have strings like these:

AB;CD;EF;GH;IJ

Is there an easy way to count the number of elements in the string.
In this case the count would be 5.

Thank you in advance.




Leo Heuser

One way:

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

--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"carl" skrev i en meddelelse
...
I have strings like these:

AB;CD;EF;GH;IJ

Is there an easy way to count the number of elements in the string. In

this
case the count would be 5.

Thank you in advance.






All times are GMT +1. The time now is 09:21 AM.

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