Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / October 2006

Tip: Looking for answers? Try searching our database.

number of spaces...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mark - 17 Oct 2006 16:58 GMT
Hello.

I know someone showed me this before, but I've forgotten.

If I wanted to do a count of the number of spaces within a single cell, how
could I do that?

For instance, if I wanted to look at a cell that contained 'A B C D', and
get the answer that there are three spaces in that.

Thanks.
Mark
Bernard Liengme - 17 Oct 2006 17:07 GMT
=LEN(A1)-LEN(SUBSTITUTE(A1," ",""))
best wishes
Signature

Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

> Hello.
>
[quoted text clipped - 9 lines]
> Thanks.
> Mark
Dave Peterson - 17 Oct 2006 17:11 GMT
=(len(a1)-len(substitute(a1," ","")))/len(" ")

Since you're only counting a single character, you could eliminate the
denominator:

=len(a1)-len(substitute(a1," ",""))

> Hello.
>
[quoted text clipped - 8 lines]
> Thanks.
> Mark

Signature

Dave Peterson

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.