# How to Reverse Names in Excel (5 Handy Methods)

Get FREE Advanced Excel Exercises with Solutions!

Do you want to learn how to reverse names in Excel with some exciting formulas? This article is for you. Here we discussed 5 simple and handy methods to reverse names in Excel.

Here, we have a list of the Full Name of some employees of a company. Now, we will demonstrate the procedures for reversing the names of the employees according to your needed orders. Not to mention that we have used Microsoft Excel 365 to create this article, but you can use any other version at your convenience.

## 1. Using Flash Fill Feature to Reverse Names in Excel

In the beginning, we can use the Excel Flash Fill feature to reverse names in Excel. To reverse the Full Name, follow the steps below.

📌 Steps:

• First, write the first name in your desired order like in the screenshot shown below. • Then select the first cell of the Reverse Name column and go to the Home tab >> Fill drop-down >> Flash Fill. • Next, click on cell C5 and then drag down the Fill Handle tool for other cells. • After that, if the displayed result is your desired one, then click on the icon shown in the figure and select Accept suggestions. Therefore, you’ll see that the given names have been reversed. This is how to reverse names in Excel.

## 2. Reversing Names with MID, SEARCH, and LEN Functions

In this method, we use the combination of MID, SEARCH, and LEN functions to reverse the names. 📌 Steps:

• Select cell C5 and Write down the function stated below.
=MID(B5&” “&B5,SEARCH(” “,B5)+1,LEN(B5))

You can also write it on the function box.

Here, B5 is the First Name of the employee.

Formula Breakdown:

• LEN(B5) → becomes
• LEN(“Henry Matt”) → The LEN function determines the length of the characters
• Output → 10
• SEARCH(” “,B5) → becomes
• SEARCH(” “,“Henry Matt”) → The SEARCH function finds the position of space in the text Henry Matt
• Output → 6
• SEARCH(” “,B5)+1 → becomes
• 6+1 → 7
• B5&” “&B5 → becomes
• “Henry Matt”&” “&“Henry Matt” → The Ampersand Operator will add up the two texts Henry Matt
• Output → “Henry Matt Henry Matt”
• MID(B5&” “&B5,SEARCH(” “,B5)+1,LEN(B5)) → becomes
• MID(“Henry Matt Henry Matt”,7,10) → Here, 7 is the start number of the characters and 10 is the total number of characters which we will extract using the MID function from the text “Henry Matt Henry Matt”.
• Output → Matt Henry • After writing the function press ENTER and you will get the result.
• Use FIll Handle for the other cells and this will flip the names. After that, you will have the following result. ## 3. Flipping Names with Comma in Excel

Sometimes your dataset has names separated by a comma. If you want to switch it, then follow the steps below. 📌 Steps:

• Select cell C5 and write down the functions stated below.

=MID(B5&” “&B5,SEARCH(“,”,B5)+2,LEN(B5)-1)

Here, B5 is the First Name of the employee.

Formula Breakdown:

• LEN(B5)-1 → becomes
• LEN((“Henry, Matt”)-1) → The LEN function determines the length of the characters
• Output → 10
• SEARCH(“, “,B5) → becomes
• SEARCH(“, “,“Henry, Matt”) → The SEARCH function finds the position of space in the text Henry Matt
• Output → 6
• SEARCH(” “,B5)+2 → becomes
• 6+2 → 8
• B5&” “&B5 → becomes
• “Henry, Matt”&” “&“Henry, Matt” → The Ampersand Operator will add up the two texts Henry Matt
• Output → “Henry, Matt Henry, Matt”
• =MID(B5&” “&B5,SEARCH(“,”,B5)+2,LEN(B5)-1)→ becomes
• MID(“Henry, Matt Henry, Matt”,8,10) → Here, 8 is the start number of the characters and 10 is the total number of characters which we will extract using the MID function from the text “Henry, Matt Henry, Matt”.
• Output → Matt Henry • Next, press ENTER after writing the functions.
• Lastly, use Fill Handle for the other cells and this will switch your names. Afterward, the following results will appear in the Reverse Name column. ## 4. Reversing Names in Excel Without a Comma

If your dataset has names without a comma but you want to flip it with a comma then follow the steps. 📌 Steps:

• First, select the cell C5 and write down the functions stated below
=MID(B5&”, “&B5,SEARCH(” “,B5)+1,LEN(B5)+1)

Here, B5 is the First Name of the employee.

Formula Breakdown:

• LEN(B5)+1 → becomes
• LEN((“Henry Matt”)+1) → The LEN function determines the length of the characters
• Output → 11
• SEARCH(“, “,B5)+1 → becomes
• SEARCH((“, “, “Henry Matt”)+1) → The SEARCH function finds the position of space in the text Henry Matt
• Output → 6+1→7
• B5&”, “&B5 → becomes
• “Henry Matt”&”,”&“Henry Matt” → The Ampersand Operator will add up the two texts Henry Matt
• Output → “Henry Matt, Henry Matt”
• =MID(B5&” “&B5,SEARCH(“,”,B5)+2,LEN(B5)-1)→ becomes
• MID(“Henry Matt, Henry Matt”,7,11) → Here, 7 is the start number of the characters and 11 is the total number of characters which we will extract using the MID function from the text “Henry Matt, Henry Matt”.
• Output → Matt, Henry • Press ENTER.
• Use Fill Handle for the other cells and reverse the names without commas. Finally, you will have the following result. Read More: How to Reverse a String in Excel

## 5. Reversing Names with Excel VBA

Lastly, we can also reverse the name using the VBA code, a programming language for Microsoft Excel and other office tools. 📌 Steps:

• Go to the Developer tab >> Visual Basic option. • Click on the Insert tab and then select the Module option. Afterward, Module 1 will be created where we will insert our code. • Write down the following VBA code inside the created module
``````Sub name_flip()
Dim rng As Range
Dim wrk_rng As Range
Dim sym As String
On Error Resume Next
Set wrk_rng = Application.Selection
Set wrk_rng = Application.InputBox("Range", "Exceldemy", wrk_rng.Address, Type:=8)
sym = Application.InputBox("Symbol interval", "Exceldemy", " ", Type:=2)
For Each rng In wrk_rng
yValue = rng.Value
name_list = VBA.Split(yValue, sym)
If UBound(name_list) = 1 Then
rng.Offset(0, 1) = name_list(1) + sym + name_list(0)
End If
Next
End Sub``` Here, name_flip is the sub-procedure name. We have declared rng, wrk_rng as Range, sym as String. ``` • Next, run the code by pressing the F5 button and an input box will appear.
• Select all the cells you want to reverse (here, \$B\$5:\$B\$8 is our selected range) and press OK. • Then, another input box will pop up.
• Type a comma (,) as the symbol for interval and press OK. • Consequently, you will get your result. Read More: How to Use Excel VBA to Reverse String

## What is ExcelDemy?

ExcelDemy Learn Excel & Excel Solutions Center provides free Excel tutorials, free support , online Excel training and Excel consultancy services for Excel professionals and businesses. Feel free to contact us with your Excel problems. Fahim Shahriyar Dipto

Hello! Welcome to my Excel blog! I am a big fan of MS Excel. I am learning new and exciting things in Excel and writing the process here. I think this will be helpful for you to get used to Excel. Keep visiting our website for new and updated Excel methods.

1. Reply Muhamamd Shahid Iqbal Sep 23, 2022 at 3:58 PM

I Want to Copy many Rows by Selection from one sheet to another sheet using Macro. Is it possible? Advanced Excel Exercises with Solutions PDF  