This can easily be done in Excel with the PROPER function.
PROPER function
ThePROPER functionautomatically reformats text so that all words are capitalized.
At the same time, it lowercases all other text.
The result is returned to PROPER, which capitalizes each word as before.
Numbers, punctuation, and spaces are not affected.
TEXTBEFORE Function
The Excel TEXTBEFORE function returns the text that occurs before a given substring or delimiter.
TEXTAFTER Function
The Excel TEXTAFTER function returns the text that occurs after a given substring or delimiter.