+ Reply to Thread
Results 1 to 4 of 4

combining substitute and concatenate

  1. #1
    Registered User
    Join Date
    02-21-2010
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    2

    combining substitute and concatenate

    I need to reverse the order of the first/last name as well as remove the space between names that have mac in them. So for instance cell C13 contains the name "Elanor Mac Gowan" would need to be changed to "MACGOWAN ELANOR" I also need to make the whole thing upper case

    So far I have =UPPER(RIGHT(C13,(LEN(C13)-(FIND(" ",C13))))&" "&LEFT(C13,(FIND(" ",C13))))

    Which reverses the names fine.

    I also have =SUBSTITUTE(C13,"Mac ", "Mac") However I can't figure out how to merge the two..
    Last edited by sackling; 02-21-2010 at 02:17 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    re: excel name change formula

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    Title changed, read the Forum Rules before posting again
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    re: combining substitute and concatenate

    One possibility

    =UPPER(TRIM(MID(REPT(SUBSTITUTE(C13," ","",2)&" ",2),FIND(" ",C13)+1,LEN(C13))))

    or

    =UPPER(SUBSTITUTE(REPLACE(C13,1,FIND(" ",C13),"")," ","")&" "&LEFT(C13,FIND(" ",C13)-1))
    Last edited by DonkeyOte; 02-21-2010 at 02:22 PM. Reason: added 2nd more traditional approach

  4. #4
    Registered User
    Join Date
    02-21-2010
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    2

    re: combining substitute and concatenate

    Thanks So much I am going to go with the second one. I will have to look at it to figure out how exactly you did this. Thanks again!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1