Split first and last name

I have a single column for first and last name, and I want to split the text. I was trying to use the comma split text function, so I can pull out the last name only, but it’s not working because there is no comma to use as the separator. I’m doing this because I want to use alphabetization of the last name to sort the data when it is presented to the user on the app.

I maybe able to help, so to understand it correctly, what format is the name in? For example:
John Doe
Doe John
John D
D John

It’s formatted as John Doe, so when I have all the names listed on the app, I want it to alphabetized by the last name.

Gotcha! you can use the split text function, erase the comma and use space as the splitter. Then you can use the single value function to pull that last name and store it in its own column which you can use to sort. Here’s a short video showing how to achieve that.
Extract Last Name

Yeah, what you’re doing in your recording is the way I was trying to do it as well, but it’s not working when I do it for some reason. As far as I can tell, I’m doing the exact same thing you’re doing. I screen recorded myself doing it just now, but how do I attach a video clip here? I only see that I can attach a still image file.

you can either convert the video to gif and upload the gif here, or you can upload it to google drive and share it via link

https://drive.google.com/file/d/1x7d9M76dhvIRzkkJUG97YEyh-_BSQcMO/view?usp=sharing

Can you manually retype one of the names? Don’t use copy and paste. How did the name column get populated in the first place?

Yeah, I tried doing that, but it didn’t work. I think I free typed most of them.https://drive.google.com/file/d/1hfxTh3_gOaiVNKhslyq-mZffA6POVyWY/view?usp=sharing

Just to test it out, I jus created a brand new table with a brand new text column where I typed out a name. Then I added a brand new split text column with a space as a the separator, and it didn’t work then either.

https://drive.google.com/file/d/1Rflq6-WsBr9XH89eEs7Wj0gCRubOiM0r/view?usp=sharing

That is strange, I would ask you to try a few things. First of, try refreshing the page. Sometimes if the editor is open for a very long time, it causes issues where computed columns don’t work as expected.
If that doesn’t help, I’m thinking if it’s because the Name column is being used by some other column or action that’s altering the normal text format where it won’t count the space.

1 Like

No go on any of those. I also tried them all on my brand new sheet, and nothing is working.https://drive.google.com/file/d/1lRg8pYvuTs8ZqmP-v9R6xrlbFTM0OAbB/view?usp=sharing

Okay let’s try a different method by using excel formula function instead of split function.
Create an excel formula column and use this configuration:
formula: RIGHT(A1, LEN(A1) - FIND(" ", A1))

1 Like

Yeah, it seems to be working for me, so I’m not sure why the Split Text column wouldn’t work.

Aha! The formula worked! Thank you so much for taking the time to help me!

Yeah, the split text was my first thought, but I can’t get it to work for some reason, so strange!

1 Like

Awesome!
Yes that is very strange as to why the split text did not work. Might be a bug casing it to not read " ". glad I was able to help using a different method!

1 Like

I was having a similar issue but fixed it by switching over to Google Chrome vs. Safari.