View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default counting spaces in a string

1. =LEN(A1)-LEN(SUBSTITUTE(A1," ",""))
2. =FIND(" ",A1,FIND(" ",A1,FIND(" ",A1,FIND(" ",A1)+1)+1)+1)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"xnman" wrote in message
...
1. Is there a simple way to count the spaces in a long string?
2. If you have multiple spaces in a string, is there a simple way to
determine what position in the string, number 4 space is?

Thanks
xnman