+ Reply to Thread
Results 1 to 7 of 7

How to separate first and last names entered in one cell into two different cells

  1. #1
    Registered User
    Join Date
    11-07-2008
    Location
    St. Louis, Missouri, USA
    MS-Off Ver
    2003
    Posts
    50

    How to separate first and last names entered in one cell into two different cells

    The database that I'm working on divides patient names into three separate columns: lastName, firstName, midInit. My department has several old spreadsheets that have data my boss suddenly wants included in my database. The trouble is, these old spreadsheets have the patient's last name, first name, and middle initial entered into the same column. There are at least 200 hundred names in these spreadsheets. I absolutely do not want to go back and separate the names into separate columns by hand.

    Is there any way to get Excel to take the names entered into one cell and split them into three cells?

    I've attached a spreadsheet example that shows what I need to do.
    Attached Files Attached Files
    Last edited by Research RN; 02-04-2009 at 03:56 PM.

  2. #2
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: How to separate first and last names entered in one cell into two different cells

    look at the file attached.
    I am sure someone will give you a better solution.
    But it's a start. You'll get the idea.
    modytrane.
    Attached Files Attached Files

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How to separate first and last names entered in one cell into two different cells

    well first stab
    allowing for fact you have a rogue full stop and odd spaces
    for last name
    =LEFT(D4,FIND(",",D4)-1)
    for first name
    =TRIM(LEFT(MID(D4,FIND(",",D4)+1,255),FIND(" ",TRIM(MID(D4,FIND(",",D4)+1,255)))))
    and for initial
    =TRIM(RIGHT(D4,2))

  4. #4
    Registered User
    Join Date
    11-07-2008
    Location
    St. Louis, Missouri, USA
    MS-Off Ver
    2003
    Posts
    50

    Re: How to separate first and last names entered in one cell into two different cells

    Quote Originally Posted by modytrane View Post
    look at the file attached.
    I am sure someone will give you a better solution.
    But it's a start. You'll get the idea.
    modytrane.
    It works pretty well!

    The only problem is that if a name has no middle initial then the formula breaks off the last two letters of the first name and puts them into the midInit column. So Williams, Jimmy becomes:

    Williams | Jim | my
    Last edited by Research RN; 02-04-2009 at 12:11 PM.

  5. #5
    Registered User
    Join Date
    11-07-2008
    Location
    St. Louis, Missouri, USA
    MS-Off Ver
    2003
    Posts
    50

    Re: How to separate first and last names entered in one cell into two different cells

    Quote Originally Posted by martindwilson View Post
    well first stab
    allowing for fact you have a rogue full stop and odd spaces
    for last name
    =LEFT(D4,FIND(",",D4)-1)
    for first name
    =TRIM(LEFT(MID(D4,FIND(",",D4)+1,255),FIND(" ",TRIM(MID(D4,FIND(",",D4)+1,255)))))
    and for initial
    =TRIM(RIGHT(D4,2))
    Thanks very much.

    Your formula for the middle initial appears to solve the problem I mentioned in reply to Modytrane above.

    Thanks to both of you!

    -Edit-

    Oops may have spoke too soon.
    Please Login or Register  to view this content.
    Also breaks off the last two letters of the first name if the name has no middle initial.
    Last edited by Research RN; 02-04-2009 at 12:28 PM.

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How to separate first and last names entered in one cell into two different cells

    insert 2 columns after list of names
    select column with names
    find /replace fullstop with nothing
    select column again
    data/text to columns
    delimited
    check "space",check "other "put a ,(comma) in box next to "other", make sure the treat consecutive delimiters as one is ticked ,click finish
    Last edited by martindwilson; 02-04-2009 at 08:10 PM.

  7. #7
    Registered User
    Join Date
    11-07-2008
    Location
    St. Louis, Missouri, USA
    MS-Off Ver
    2003
    Posts
    50

    Re: How to separate first and last names entered in one cell into two different cells

    Quote Originally Posted by martindwilson View Post
    insert 2 columns after list of names
    select column with names
    find /replace fullstop with nothing
    select column again
    data/text to columns
    delimited
    check "space",check "other "put a ,(comma) in box next to "other", make sure the treat consecutive delimiters as one is ticked ,click finish
    Thanks very much!

+ 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