0

Having an excel column as below:

excel

I need to find out the number of words in the column.

mg

3
  • How DOG,CAT,ELEPHANT count 4? It should be 3. Commented Dec 12, 2022 at 9:23
  • sorry my mistake Commented Dec 12, 2022 at 9:28
  • What are the odds there is a comma inside the substrings? E.g: ['A','B,C,D','E,F'] Commented Dec 12, 2022 at 12:13

2 Answers 2

2

Try below formula-

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

For dynamic spill array.

=MAP(A2:A5,LAMBDA(x,LEN(x)-LEN(SUBSTITUTE(x,",",""))+1))

enter image description here

Sign up to request clarification or add additional context in comments.

6 Comments

Dada, TEXTSPLIT() was nice, why did you miss that
@MayukhBhattacharya For older version support as well as, Jos Woolley already posted that.
Harun Dada, this will be short: =MAP(A2:A3,LAMBDA(x,COUNTA(TEXTSPLIT(x,","))))
Alright dada. But you could have shown with MAP()
@MayukhBhattacharya The I would go with =MAP(A2:A5,LAMBDA(x,SUM(--(TEXTSPLIT(x,",")<>"")))).
|
1

If you have TEXTSPLIT:

=COUNTA(TEXTSPLIT(A1,","))

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.