+ Reply to Thread
Results 1 to 3 of 3

Formula to remove unwanted data & rearrange last name & first name in a cell

  1. #1
    Registered User
    Join Date
    07-12-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2003
    Posts
    2

    Formula to remove unwanted data & rearrange last name & first name in a cell

    I have data in a column that looks as such:

    SMITH_JOHN.TGA
    JONES_SAM.TGA
    MARTIN_DONALD.TGA

    I'm simply trying to find a formula that will remove the .TGA from the name and swap the first name and last name so the results would look like:

    JOHN SMITH
    SAM JONES
    DONALD MARTIN


    I can accomplish this using multiple formulas across multiple cells, but I'm looking for a single formula or VBA script to do the work without all the clutter.

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Formula to remove unwanted data & rearrange last name & first name in a cell

    hi rbecker69, welcome to the forum. try:
    =SUBSTITUTE(MID(A1,FIND("_",A1)+1,LEN(A1)),".TGA"," ")&LEFT(A1,FIND("_",A1)-1)

    or:
    =SUBSTITUTE(TRIM(MID(SUBSTITUTE(A1&" "&A1,"_",REPT(" ",99)),99,99)),".TGA","")

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    07-12-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Formula to remove unwanted data & rearrange last name & first name in a cell

    Perfect! Thanks for the help.

+ 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