Counting Texts

K

Keith

If cell A1 contains a paragraph of texts and if I want to count just letter
"W"s (Upper or lower case), How can I achieve this?

Example: A1 contains "How now brown cow" the formula should return "4".

Thank you.
 
C

Chris Watts

Write a macro and use the VBA functions Instr(strName, "w") together with
Split(strName, "w") and count the number of times that it finds "w" or "W"

Chris
 
S

Shane Devenshire

Try this spreadsheet formula:

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

since SUBSTITUTE is case sensitive you can modify this to read

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top