In this case, you can try method C. Remove all excess spaces including non-printing characters and non-breaking space. The TEXTBEFORE function in Excel is specially designed to return the text that occurs before a given character or substring (delimiter). 2. Thanks!!!