CONCATENATE, LEN, FIND, RIGHT, LEFT Workout
- 02:46
Review how to extract data from a text string
Transcript
In the data presented to us in columns B, C, and D, we have student names, their first name, last name and then an exam grade. what we'd like to do is change the presentation of this to make it a bit more useful. First of all I'd like to put together the first and last name. We can use two ways to do this. The first way is to join them together so I hit equals, B6, and then I use my ampersand symbol and then C6. We're going to come across a slight problem here, 'cause if I press enter, I haven't left a space in the middle so I need to join together a space as well as the two names. So I now have B6, first name, and the space and the last name, C6. Hence I had the two ampersands this time. So press enter. That gives me the first name and last name joined together. Alternatively, we could have used the concatenate function. The concatenate function asks, "What do you want to join together? Want to join B6?" Then I need the same quotes, space, quotes. I hit comma again, and now go for C6. That's exactly the same thing.
Now let's say we were presented with the two names together and we now want to split them apart. Well, to do this, we start by using the LEN function. The LEN function works out the length in number of characters of your name. So I can see that Marisol has seven characters, Appell has six and the space in the middle means we have 14 in total. I can now use that to help me find just the first name. In order to do that, I need to use the find function first. I want to find the blank space in between the two names. So find the blank space. Where do I want to find it? Within E6. That tells me that that is in position eight, it's the eighth character. So now if I use the left function, the left function will find me the first name by combining the two we've already used. So it asks me, "Where is your text?" My text is in cell E6. Then ask how many characters do you want to go from the left? I want to go from the left, eight minus one. That will get me the first seven characters. Giving me the Marisol. Alternatively, I may want just the last name, in which case we use the right function. The right function again asks, "Where is your text?" It's in E6. And I want to go from the right LEN minus find.
And that gets me just last six characters. We can copy all of this down to make sure that it works correctly. So I hit control D to copy down. That has now joined all of the first and last names together. It's found the length, it's found where the space is and it's then separated them out again, first name and last name.