Formula to reverse order of name and surname in the same cell

Almir's picture

You might get a list with names and surnames stored in the same cell, and you need to reverse their order (from "Name Surname" to "Surname Name"). Most common way to achieve this is through MID/LEFT/RIGHT functions or "Text to Columns" command. But that is only the first step. Next step is to concatenate cells in reverse order.

Here is a formula to get it at once, and it also works with two surnames and two names, separated by space (Caetano Gonzalez) or dash (Mary-Jane).

Assuming your data is in cell A2, type this in B2:

=PROPER(RIGHT(A2;LEN(A2)-FIND(" ";A2)) & ", " & LEFT(A2;FIND(" ";A2)-1)).

Formula finds first space (separating first name from surname), takes everything from that point to the right (surname) and places it at the beginning. Second part of formula takes everything to the left (first name) and places it at the end. Name and surname are separated by space (& " " &). You may want change it to comma-space. Finally, result is an argument of PROPER function, just to get only first letters as capitals.

Look at the attached example file.

ReverseNameSurname1.jpg
AttachmentSize
ReverseNameSurname.xlsx8.51 KB