From the course: Excel 2016: Advanced Formulas and Functions

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Using the TRIM function to remove unwanted spaces in a cell

Using the TRIM function to remove unwanted spaces in a cell

From the course: Excel 2016: Advanced Formulas and Functions

Start my 1-month free trial

Using the TRIM function to remove unwanted spaces in a cell

- In this worksheet called Trim we're looking at some data in column A and we obviously have some problems because of the unnecessary spaces. There are three kinds of unnecessary spaces. The leading spaces, we see that in front of Fox here, in front of Watanuki, perhaps some others down here. Trailing spaces, they're less of a problem, but even there, when you're trying to match up names from different locations, trailing spaces are big problems. We also have spaces, here, between the names. A function called Trim can handle all of these. Let's first show what happens if we were to sort all this like this. Now a typical scenario, you might have hundreds, maybe thousands, of names and here and there you might have one or two of them, three of them, four of them, maybe, with leading spaces or space, and you don't see a problem at all until you happen to sort the data. So, from the Data tab I'm going to click the AZ button to sort this list. And now I see, of course, what's happening…

Contents