Disclosure: This post may contain affiliate links, meaning when you click the links and make a purchase, we receive a commission.

How to Reverse Names in Excel (5 Handy Methods)

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.


Download Practice Workbook

Download the following practice workbook. It will help you to realize the topic more clearly.


5 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.

Dataset

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.

Using Flash Fill Feature to Reverse Names in Excel

  • 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.

Using Flash Fill Feature to Reverse Names in Excel

  • After that, if the displayed result is your desired one, then click on the icon shown in the figure and select Accept suggestions.

Using Flash Fill Feature to Reverse Names in Excel

Therefore, you’ll see that the given names have been reversed. This is how to reverse names in Excel.


2. Applying MID, SEARCH, and LEN Functions to Reverse Names in Excel

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.

Applying MID, SEARCH, and LEN Functions to Reverse Names in Excel


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

Flipping Names in Excel with Comma

  • 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.


Similar Readings


4. Flipping 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.

How to Reverse Names in Excel Flipping Names Without Comma

Finally, you will have the following result.


5. Reversing Names Using 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.

Using VBA code to reverse names in excel

  • Click on the Insert tab and then select the Module

Opening Module

Afterward, Module 1 will be created where we will insert our code.

Module 1

  • 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. 

Using Excel VBA code to reverse the name

  • 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.

Using Excel VBA Code

  • 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 Reverse a String in Excel (3 Suitable Ways)


Practice Section

We have provided a practice section on each sheet on the right side for your practice. Please do it by yourself.


Conclusion

So, these are some easy methods to Reverse Names in Excel. Please let us know in the comment section if you have any questions or suggestions. For your better understanding please download the practice sheet. Visit our website Exceldemy to find out different kinds of excel methods. Thanks for your patience in reading this article.


Related Articles

Fahim Shahriyar Dipto

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.

2 Comments
  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?

Leave a reply

ExcelDemy
Logo