You could use one formula to fix both incorrect capitalization and extra spaces at the same time. To do that, in cell B2 you would type a nested formula, which uses the result of one function as the argument for another function:
A set of parentheses separates the TRIM argument from PROPER. Another set of parentheses separates the cell reference (A2) that tells TRIM and PROPER what to work with.
Note The functions in this course are just a few of the many, many Excel functions you can use. In the course "Find functions and enter arguments," you can learn how to find other functions you can use for all sorts of tasks.