ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   counting (https://www.excelbanter.com/excel-discussion-misc-queries/184094-counting.html)

ALEX

counting
 
I'd like to know if you can count words inside of a cell that are separated
by a comma. For example, if i have N,S inside of a cell, I'd want a count of
2. If i had NA,S - i would still want a count of 2. NA,S,C - i would want a
count of 3. Please let me know if this is possible and how.

Thank you
Alex

Gary''s Student

counting
 
Count the number of commas and add one:

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

--
Gary''s Student - gsnu200779


"Alex" wrote:

I'd like to know if you can count words inside of a cell that are separated
by a comma. For example, if i have N,S inside of a cell, I'd want a count of
2. If i had NA,S - i would still want a count of 2. NA,S,C - i would want a
count of 3. Please let me know if this is possible and how.

Thank you
Alex


Mike H

counting
 
Maybe

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

Mike

"Alex" wrote:

I'd like to know if you can count words inside of a cell that are separated
by a comma. For example, if i have N,S inside of a cell, I'd want a count of
2. If i had NA,S - i would still want a count of 2. NA,S,C - i would want a
count of 3. Please let me know if this is possible and how.

Thank you
Alex



All times are GMT +1. The time now is 08:31 AM.

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