|
Home > Formulas > Text > Split Names Split First and Last Names in Excel
|

You can reverse first and last names with an Excel formula.
Using the following formula creates a dynamic fix, instead of a one-time solution. The formula results will update immediately, if the full name in column A is changed.

This video shows the steps to reverse first and last names with an Excel formula, and there are written steps below the video.
In column A, there is a list of names, with the last name, followed by a comma, and then the first name(s).

To reverse the names, I added a heading in cell B1, then entered this MID function formula in cell B2
The formula is in a named Excel table, so it filled down the column, automatically.
In column B, each name is reversed, and the comma is removed.

Here's the completed reverse names formula, with the MID function's 3 arguments colour coded:
The MID function returns text from a text string, and has the following 3 arguments in its syntax:
For the text argument, this formula needs two copies of the name in cell A2, with a space character between them.
With "Smith, Mary" in cell A2, this is the text string that's created:
In the centre of that text string, the person's name is exactly the result that we want:
Tip: That simple text-combining trick saves us from creating a long, complicated formula!
Next, the MID formula will tell Excel how to extract that middle section, based on where to start, and how many characters..
In this example, the text to extract starts at character number 8 -- the first letter in the name "Mary".
To automatically calculate that starting number, use the FIND function.
Start Num Result
In this example, the comma-space starts at character number 6.
The Start_Num is 8 -- (6+2)
Finally, the MID function needs the number of characters to extract.
Num_Char Result
In this example, the length in A2 is 11
The Num_Char is 10 (11-1)
In the screen shot below, in cell B2, the result is Mary Smith.
That text starts at the 8th character of the text string, "Smith, Mary Smith, Mary", and returns 10 characters.

In column A, there is a list of names, with the last name, followed by a comma-space, and then the first name(s). In Excel 2013, and later versions, you can use the Flash Fill feature, to quickly reverse the order of the names, to show the first name, then a space, and then the last name.
To use Flash Fill, type a couple of names to get started, or use the Flash Fill shortcut.


As you type, the Flash Fill feature detects a pattern, and fills in the remaining cells, based on that pattern. The list is in a light font color.


The suggested items are entered in the remaining cells, and the font changes to a dark color.
Thanks to Karen Roem, who sent these steps for using the Flash Fill Shortcut - Ctrl + E.
TIP: The same shortcut works to Flash Fill other changes, such as changing text case to Proper, UPPER or lower.


Reminder: Flash Fill is a static fix -- the reversed names are not linked to the original names, and will not automatically update, if the full name is changed, or if new names are added. For a dynamic fix, use the Reverse Names formula, in the previous section.

In this short video, Sarah shows how to separate data from one cell, into multiple columns, using the Flash Fill Shortcut - Ctrl+E
In this example, there is a list of names in column A, with the last name, followed by a comma, and then the first name(s).
A quick way to separate the names, and split names into two separate columns, is to use Excel's Text to Columns (TTC) feature.
Note: This list is in a named Excel Table. You can follow the same steps for a regular list on a worksheet.

Before splitting the names into separate cells, follow these steps, to remove the space after the comma. Otherwise, a space will appear before the first name, when it is sent to its own column. It would take extra steps to clean it up in that cell.
Before you begin, make a backup copy of the worksheet, or the workbook, just to be safe.

Next, we'll use the Text to Columns feature to split the cell contents into separate columns, based on the position of the comma..



In the Data preview window, you can see where the names will split. Because we removed the space after the comma, there is no space character before the first names.

If we hadn't removed the space after the comma, you would see a space character before each of the first names.

After setting the delimiters in Step 2, you can either:
Finish Button
For this example, we want the split names to overwrite the existing list of full names. There is no need to go to Step 3, which has more settings.

Next Button
For other lists, you might NOT want the split data to overwrite the existing list. Or, you might want to apply other optional settings from Step 3.
In Step 3, you can apply more settings, or just review the default settings.
There are notes about each setting below the screen shot.

Column Data Format
In the Data Preview window, the column headers show the data type that was assigned to the column by default. You can leave those data types as they are, or follow these steps to change a format.
Destination
By default, the destination is set as the first cell in the selected range on the Excel spreadsheet.
With that destination, the split data will overwrite the existing list of full data. To avoid overwriting the existing list, follow these steps, to change the starting position:
Advanced Button
I rarely use this button, which opens the Advanced Text Import Settings dialog box.
If the data that you're splitting has numbers, you can adjust the settings:
Close Step 3
After you finish adjusting the settings, click the Finish button, to split the names, and to close the Convert Text to Columns Wizard.
On the worksheet, the last names are in column A, and the first names have moved to column B.. Because the list is a formatted Excel table, a new column was automatically added to the table, with the default heading, "Column1".


Split or Reverse Names: Download the sample file for splitting and reversing full names. This workbook has the names for testing Text to Columns, Flash Fill, and the short formula to reverse names. The zipped file is in xlsx format, and does not contain macros.
Don't miss my monthly Excel newsletter! You'll get quick tips, article links, and a bit of fun. Add your email, and click Sign Up.
Next, when you get my reply, click the Confirm button. I add this step to protect you from spam!
| Fill Blanks -- In Excel, fill blank cells with values from cells above, manually or programmatically. Details on the Fill Blank Cells in Excel Column page. |
Increase Numbers With Paste Special
Last updated: May 23, 2026 12:02 PM