In excel, TRIM()
will remove all spaces before and after text, while also removing any duplicate spaces in between words.
Is there a formula or combination thereof that will do the same as TRIM()
but leave spaces between words as-is?
In the following example, I'm looking for a formula that will accomplish that of the fictitious formula "WXYZ":
TRIM(" Omicron Persei 8 ")
= "Omicron Persei 8"
WXYZ(" Omicron Persei 8 ")
= "Omicron Persei 8"
Note that I've read somewhere that TRIM()
in VBA will work like that of WXYZ above. However, I'm looking for a formula solution.