If none of the other answers in this post work, but the Sachin Pandit "CODE (160)" formula does, then you actually did not have any "spaces" as such [CODE (32)], but there are several inextricable spaces. To deal with text that has a double (or more) CODE (32) space between words, you can use this formula:
=IF(OR(LEFT(SUBSTITUTE(A1," ",""),1)=" ",RIGHT(SUBSTITUTE(A1," ",""),1)=" "),TRUE,FALSE)
source
share