+ Reply to Thread
Results 1 to 7 of 7

Replace text "Smith, Joe" into "Joe Smith" for a single cell

  1. #1
    Registered User
    Join Date
    04-07-2005
    Posts
    5

    Replace text "Smith, Joe" into "Joe Smith" for a single cell

    I have a separate program that generates a report that I open in Excel and for customer name, it returns it as: "Smith, Joe" into a single cell. I want it to read "Joe Smith" instead. I have found a way to separate the first and last names into a separate cell each and then combine back into "Joe Smith", but I was hoping something could be simpler.


    Thanks!

  2. #2
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    Use a helper column next to your list of names (insert a column if needed) and use this formula:

    =RIGHT(A1,FIND(",",A1,1)-3)&" "&LEFT(A1,FIND(",",A1)-1) assuming your names begin in A1. Copy this formula down the range of names.

    Smith, Joe returns Joe Smith


    HTH

    Bruce
    Bruce
    The older I get, the better I used to be.
    USA

  3. #3
    Forum Contributor
    Join Date
    06-23-2004
    Location
    Houston, TX
    Posts
    571
    Quote Originally Posted by flyingmachine
    I have a separate program that generates a report that I open in Excel and for customer name, it returns it as: "Smith, Joe" into a single cell. I want it to read "Joe Smith" instead. I have found a way to separate the first and last names into a separate cell each and then combine back into "Joe Smith", but I was hoping something could be simpler.


    Thanks!
    I do not know how you define "hoping something could be simpler" but here is something you can use.

    Assuming that your customer name (formatted "Last Name, First") is in Cell A1, you can use this formula:

    =trim(mid(A1,find(",",A1)+1,255)&" ",left(A1,find(",",A1)-1))

    Hope this helps.

    Regards.
    BenjieLop
    Houston, TX

  4. #4
    Registered User
    Join Date
    04-07-2005
    Posts
    5
    Quote Originally Posted by swatsp0p
    Use a helper column next to your list of names (insert a column if needed) and use this formula:

    =RIGHT(A1,FIND(",",A1,1)-3)&" "&LEFT(A1,FIND(",",A1)-1) assuming your names begin in A1. Copy this formula down the range of names.

    Smith, Joe returns Joe Smith


    HTH

    Bruce
    Thanks, but for different combinations of names, some letters get chopped...

    smith, joseph eph smith
    Johnson, Steve Steve Johnson
    Stevenson, Jennifer ennifer Stevenson
    Wooden, Tom Tom Wooden
    Jordan, Michael hael Jordan

  5. #5
    Registered User
    Join Date
    04-07-2005
    Posts
    5
    Quote Originally Posted by BenjieLop
    I do not know how you define "hoping something could be simpler" but here is something you can use.

    Assuming that your customer name (formatted "Last Name, First") is in Cell A1, you can use this formula:

    =trim(mid(A1,find(",",A1)+1,255)&" ",left(A1,find(",",A1)-1))

    Hope this helps.

    Regards.
    I tried to c/p that formula and this error came back:

    "You've entered too many arguments for this function.

    To get help with entering arguments for the function, click OK to close this message. Then, on the formula bar, click the equal sign button"

  6. #6
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545

    Corrected Formulas

    My Bad! Here is the corrected formula... must have been too early for my brain... sorry for the confusion:

    =RIGHT(A2,(LEN(A2)-FIND(",",A2,1))-1)&" "&LEFT(A2,FIND(",",A2)-1)


    Benji's formula also has a slight error, it is missing one '&' and its replaced by an uneeded comma:

    should be:

    =trim(mid(A1,find(",",A1)+1,255)&" "&left(A1,find(",",A1)-1))

    Either formula will get what you need....your choice.

    smith, joseph = joseph smith
    Stevenson, Jennifer = Jennifer Stevenson

    All better now!

    Bruce
    Last edited by swatsp0p; 04-07-2005 at 02:10 PM. Reason: a

  7. #7
    Registered User
    Join Date
    04-07-2005
    Posts
    5
    Very nice, thanks so much for your 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