Counting Texts

  • Thread starter Thread starter Keith
  • Start date Start date
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.
 
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
 
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",""))
 
Back
Top