Last name - first name - middle1 - middle2
How to flip the first and last name in cells in Excel?
Let's say you get a roster of names in one column, however, you need to flip the first name and last name in cells. Normally you will get into one cell and cut the last name, and then paste it before the first name, or retype the name again. It will be time-consuming and tedious if you use these traditional methods. Actually, there are several easy ways to flip or reverse the first name and last name in a single column quickly.
Supposing you have a column of names, and you need to flip the first and last name as below screenshot shown:
We can use one of Excel's formulas to flip the first and last name quickly in a column with following steps:
Enter the formula =MID(A2&" "&A2,FIND(" ",A2)+1,LEN(A2)) in a blank cell, says Cell C2. And then drag the fill handle down to the cells to apply this formula, then you can see all first and last names have been revered. See screenshot:
You can also use VBA macros to flip the first and last name in a column quickly.
1. Hold down the Alt + F11 keys in Excel, and it opens the Microsoft Visual Basic for Applications window.
2. Click Insert > Module, and paste the following macro in the Module window.
Sub FlipName() 'Updateby20131126 Dim Rng As Range Dim WorkRng As Range Dim Sign As String On Error Resume Next xTitleId = "KutoolsforExcel" Set WorkRng = Application.Selection Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8) Sign = Application.InputBox("Symbol interval", xTitleId, " ", Type:=2) For Each Rng In WorkRng xValue = Rng.Value NameList = VBA.Split(xValue, Sign) If UBound(NameList) = 1 Then Rng.Value = NameList(1) + Sign + NameList(0) End If Next End Sub
3. Press the F5 key to run this macro. In the popping up KutoolsforExcel dialog box, select the range to flip, and then click the OK button. See screenshot:
4. In the following popping up dialog box, please enter an interval symbol (such as a space), and then click the OK button. See screenshot:
5. Now the first name and last name in selected range are flipped. See screenshot:
With Kutools for Excel’s Reverse Text Order, you can quickly reverse order of the text in the cells.
|Kutools for Excel : with more than 120 handy Excel add-ins, free to try with no limitation in 60 days.|
If you have installed Kutools for Excel, please do as following steps:
1. Select the range that you want to reverse the first and last names.
2. Click Kutools > Text > Reverse Text Order, see screenshot:
3. In the Reverse Text dialog box, specify a separator your selected text string using, (in this case, I select Space option) and then click the OK button. And all the first names and last names in the selected range have been reversed. See screenshot:
Note: Checking Skip non-text cells to prevent you reversing the numbers in selected range.
If you want to know more about this feature, please click Reverse Text Order.
Recommended Productivity Tools
Bring handy tabs to Excel and other Office software, just like Chrome, Firefox and new Internet Explorer.
Amazing! Increase your productivity in 5 minutes. Don't need any special skills, save two hours every day!
200 New Features for Excel, Make Excel Much Easy and Powerful:
- Merge Cell/Rows/Columns without Losing Data.
- Combine and Consolidate Multiple Sheets and Workbooks.
- Compare Ranges, Copy Multiple Ranges, Convert Text to Date, Unit and Currency Conversion.
- Count by Colors, Paging Subtotals, Advanced Sort and Super Filter,
- More Select/Insert/Delete/Text/Format/Link/Comment/Workbooks/Worksheets Tools...
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
- To post as a guest, your comment is unpublished.· 7 months agoCorrection. What if i have four names? What's the formula?
Last name - first name - middle1 - middle2
- To post as a guest, your comment is unpublished.· 7 months agoIf you have middle name how do you flip the last name? Example below.
Last name - first name - middle name
- To post as a guest, your comment is unpublished.· 1 years agoTHANKS!!!!! This formula just saved me a bunch of time. I am sure I will use it again and again.
- To post as a guest, your comment is unpublished.· 1 years agoPlease help I need a formula to flip Alexa Victoria G. Garcia to Garcia, Alexa Victoria G.
Please help Thank you
- To post as a guest, your comment is unpublished.· 1 years agoA suggestion - In an effort to encourage good programming practices (Option Explicit), please dim all variables.