SOLVED
Home

Reverse name order

%3CLINGO-SUB%20id%3D%22lingo-sub-655500%22%20slang%3D%22en-US%22%3EReverse%20name%20order%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-655500%22%20slang%3D%22en-US%22%3E%3CP%3EI%20used%20to%20do%20complicated%20macros%20years%20ago%2C%20but%20I%20either%20forgot%20something%20or%20the%20options%20have%20changed.%26nbsp%3B%20I%26nbsp%3B%20can%20still%20do%20some%20macros%2C%20but%20not%20edit%20a%20cell.%26nbsp%3B%20I%20have%20a%20list%20of%20names%20that%20are%20%22Last%20name%2C%20First%20name%22%20and%20I%20want%20to%20reverse%20it%20so%20that%20it%20is%20%22First%20name%20Last%20name%22.%26nbsp%3B%20I%20intended%20to%20go%20to%20the%20comma%2C%20cut%20the%20last%20name%20from%20the%20front%20of%20the%20cell%2C%20go%20to%20the%20end%20of%20the%20cell%20and%20paste%20it%2C%20but%20once%20I%20go%20into%20the%20cell%2C%20I%20can't%20select%20the%20%22goto%22%20or%20the%20%22find%22%20function%20to%20be%20able%20to%20do%20that.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-655500%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-655695%22%20slang%3D%22en-US%22%3ERe%3A%20Reverse%20name%20order%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-655695%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F348551%22%20target%3D%22_blank%22%3E%40joni_CCD-8244%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20don't%20need%20a%20macro%20to%20do%20that.%3C%2FP%3E%3CP%3EThis%20formula%20does%20the%20trick%3A%3C%2FP%3E%3CPRE%3E%3DRIGHT(A1%2CLEN(A1)-SEARCH(%22%2C%22%2CA1)-1)%26amp%3B%22%20%22%26amp%3BLEFT(A1%2CSEARCH(%22%2C%22%2CA1)-1)%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F116482i71031431209331C0%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Reverse%20name%20order.png%22%20title%3D%22Reverse%20name%20order.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20even%20do%20that%20without%20using%20any%20formula!%3C%2FP%3E%3CP%3EBy%20using%20the%20%3CA%20href%3D%22https%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2Fusing-flash-fill-in-excel-3f9bcf1e-db93-4890-94a0-1578341f73f7%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EFlash%20Fill%3C%2FA%3E.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20that%20helps%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-655697%22%20slang%3D%22en-US%22%3ERe%3A%20Reverse%20name%20order%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-655697%22%20slang%3D%22en-US%22%3EYou%20may%20try%20this%20formula%20in%20B2%2C%20assuming%20the%20text%20you%20want%20to%20convert%20is%20in%20A2%3A%3CBR%20%2F%3E%3DRIGHT(A2%2CLEN(A2)-FIND(%E2%80%9C%2C%E2%80%9D%2CA2)%2B1)%26amp%3B%E2%80%9D%20%E2%80%9C%26amp%3B%3CBR%20%2F%3ELEFT(A2%2CLEN(A2)-FIND(%E2%80%9C%2C%E2%80%9D%2CA2)-1)%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-655842%22%20slang%3D%22en-US%22%3ERe%3A%20Reverse%20name%20order%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-655842%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F280482%22%20target%3D%22_blank%22%3E%40Twifoo%3C%2FA%3E%26nbsp%3B%20%26nbsp%3BThe%20formula%20didn't%20work.%26nbsp%3B%20I%20received%20a%20%23VALUE!%20error.%26nbsp%3B%20I%20did%20copy%20and%20paste%20the%20formula%2C%20so%20I%20know%20I%20did%20not%20make%20a%20typo.%3C%2FP%3E%3CP%3EAnother%20response%20from%20another%20trusted%20community%20member%20suggested%20using%20Flash%20Fill%20and%20that%20worked%20beautifully.%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20for%20your%20time%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-655856%22%20slang%3D%22en-US%22%3ERe%3A%20Reverse%20name%20order%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-655856%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F35679%22%20target%3D%22_blank%22%3E%40Haytham%20Amairah%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20formula%20gave%20me%20a%20%23VALUE!%20error%20(and%20I%20copied%20and%20pasted%20your%20formula)%3B%20HOWEVER%2C%20your%20suggestion%20to%20use%20Flash%20Fill%20worked%20beautifully.%26nbsp%3B%20Thank%20you%20so%20much.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-655917%22%20slang%3D%22en-US%22%3ERe%3A%20Reverse%20name%20order%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-655917%22%20slang%3D%22en-US%22%3EI%E2%80%99m%20glad%20to%20know%20that%20you%20achieved%20your%20objective%20although%20the%20best%20response%20didn%E2%80%99t%20come%20from%20me.%20What%20matters%20most%20is%20that%20you%20were%20able%20to%20achieve%20your%20objective!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-655925%22%20slang%3D%22en-US%22%3ERe%3A%20Reverse%20name%20order%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-655925%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F348551%22%20target%3D%22_blank%22%3E%40joni_CCD-8244%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20seems%20that%20the%20names%20in%20your%20original%20data%20are%20not%20separated%20by%20a%20%3CSTRONG%3Ecomma%2Bspace%3C%2FSTRONG%3E%20just%20%3CSTRONG%3Espace%3C%2FSTRONG%3E%3F%3F%3C%2FP%3E%3CP%3EIf%20so%2C%20try%20this%20formula%20instead%3A%3C%2FP%3E%3CPRE%3E%3DRIGHT(A1%2CLEN(A1)-SEARCH(%22%20%22%2CA1))%26amp%3B%22%20%22%26amp%3BLEFT(A1%2CSEARCH(%22%20%22%2CA1)-1)%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20that%20helps%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1132655%22%20slang%3D%22en-US%22%3ERe%3A%20Reverse%20name%20order%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1132655%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F35679%22%20target%3D%22_blank%22%3E%40Haytham%20Amairah%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3BI%20am%20trying%20to%20use%20your%20formula%20as%20well%20but%20the%20names%20I%20use%20are%20a%20bit%20more%20complex.%3C%2FP%3E%3CP%3EFor%20the%20name%3A%20de%20Bakker%20Alexandra%3C%2FP%3E%3CP%3EI%20receive%3A%20Bakker%20Alexandra%20de%20with%20your%20formula.%3C%2FP%3E%3CP%3EI%20want%20to%20obtain%20Alexandra%20de%20Bakker%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20can%20I%20do%20this%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20for%20your%20help.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1141351%22%20slang%3D%22en-US%22%3ERe%3A%20Reverse%20name%20order%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1141351%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F535494%22%20target%3D%22_blank%22%3E%40nauwelaertsevelien%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20this%20case%2C%20try%20this%20formula%3A%3C%2FP%3E%3CPRE%3E%3DIF(LEN(A1)-LEN(SUBSTITUTE(A1%2C%22%20%22%2C%22%22))%2B1%26gt%3B2%2C%3CBR%20%2F%3ERIGHT(A1%2CLEN(A1)-SEARCH(%22%20%22%2CA1%2CSEARCH(%22%20%22%2CA1)%2B1))%26amp%3B%22%20%22%26amp%3BLEFT(A1%2CSEARCH(%22%20%22%2CA1%2CSEARCH(%22%20%22%2CA1)%2B1)-1)%2C%3CBR%20%2F%3ERIGHT(A1%2CLEN(A1)-SEARCH(%22%20%22%2CA1))%26amp%3B%22%20%22%26amp%3BLEFT(A1%2CSEARCH(%22%20%22%2CA1)-1))%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20that%20helps%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

I used to do complicated macros years ago, but I either forgot something or the options have changed.  I  can still do some macros, but not edit a cell.  I have a list of names that are "Last name, First name" and I want to reverse it so that it is "First name Last name".  I intended to go to the comma, cut the last name from the front of the cell, go to the end of the cell and paste it, but once I go into the cell, I can't select the "goto" or the "find" function to be able to do that.

8 Replies
Highlighted
Solution

Hi @joni_CCD-8244,

 

You don't need a macro to do that.

This formula does the trick:

=RIGHT(A1,LEN(A1)-SEARCH(",",A1)-1)&" "&LEFT(A1,SEARCH(",",A1)-1)

 Reverse name order.png

 

You can even do that without using any formula!

By using the Flash Fill.

 

Hope that helps

Highlighted
You may try this formula in B2, assuming the text you want to convert is in A2:
=RIGHT(A2,LEN(A2)-FIND(“,”,A2)+1)&” “&
LEFT(A2,LEN(A2)-FIND(“,”,A2)-1)
Highlighted

@Twifoo   The formula didn't work.  I received a #VALUE! error.  I did copy and paste the formula, so I know I did not make a typo.

Another response from another trusted community member suggested using Flash Fill and that worked beautifully. 

Thank you for your time

Highlighted

@Haytham Amairah 

The formula gave me a #VALUE! error (and I copied and pasted your formula); HOWEVER, your suggestion to use Flash Fill worked beautifully.  Thank you so much.

Highlighted
I’m glad to know that you achieved your objective although the best response didn’t come from me. What matters most is that you were able to achieve your objective!
Highlighted

@joni_CCD-8244

 

It seems that the names in your original data are not separated by a comma+space just space??

If so, try this formula instead:

=RIGHT(A1,LEN(A1)-SEARCH(" ",A1))&" "&LEFT(A1,SEARCH(" ",A1)-1)

 

Hope that helps

Highlighted

@Haytham Amairah 

 

Hi,

 

 I am trying to use your formula as well but the names I use are a bit more complex.

For the name: de Bakker Alexandra

I receive: Bakker Alexandra de with your formula.

I want to obtain Alexandra de Bakker

 

How can I do this?

 

Thank you for your help.

Highlighted

@nauwelaertsevelien

 

Hi,

 

In this case, try this formula:

=IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))+1>2,
RIGHT(A1,LEN(A1)-SEARCH(" ",A1,SEARCH(" ",A1)+1))&" "&LEFT(A1,SEARCH(" ",A1,SEARCH(" ",A1)+1)-1),
RIGHT(A1,LEN(A1)-SEARCH(" ",A1))&" "&LEFT(A1,SEARCH(" ",A1)-1))

 

Hope that helps

Related Conversations
Flip Videos Recorded In Streams
smcelvain11 in Microsoft Stream Forum on
12 Replies
Site name in Windows Explorer
Bas_B in SharePoint on
1 Replies
How to get the highest value PER name in list?
Dragon_Claw in Excel on
3 Replies