I am trying to figure out how to get the WHOLE word to the left or right of an anchor term using a formula.

For example:

IF anchor term = 'excel formula'

Word to left or right.PNG

Here is a sample workbook:
Word to Left or Right Formula.xlsx

I'm sure this is a simple len formula but I run into issues if the word has white space in the front and back or doesn't.