How to Get Middle Name from Splitting Full Name in Google Sheets
Learn how to extract middle names from full names in Google Sheets by using the SPLIT function and INDEX to handle names with varying lengths.
So you may know how to get the first name. We're gonna split by a space and that gives us first name and last name. But if we have a middle name here, it's going to cause a problem. So how do we know we have a middle name? We can add at the beginning. If count. All the split A two is greater than two. Then if that's true, we want to do something different. But if it's false, meaning it's 2 or less, we just want to split . What do we want to split ? We want to split , and we also want to index first row, first column. And we want to concatenate this index with a space and a column. index two. So we're going to get the second column, but see, we only getting the first name. We're not getting the last name. So here we just want to get index row one, column one. How Does Split Work? How To Get Last Word in Cell
So we're just going to get the first name. And if there's a middle name, we'll also get it. Now we will get the last name. The last name is actually pretty simple equals split a two. A eliminator of space and we're gonna take the index of the last item. So how do we get the last item? We just count them, count all split A two with a space, and that way the count, however many there are, we're always getting the last one. And so we always get the last name here, and we always get either the first name or first and middle name. How Does Split Work? How To Get Last Word in Cell