+ Reply to Thread
Results 1 to 4 of 4

splitting first, last, middle initial in separate columns

  1. #1
    Forum Contributor
    Join Date
    09-19-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2007
    Posts
    140

    splitting first, last, middle initial in separate columns

    Hey all,

    I am having some difficulty coming up with an excel formula that splits last name, first name, and middle initials in separate columns. There's variation where the middle initial may be one letter or an entire word and sometimes the character "&" is tossed at the end of column:
    CAGLE,DANNY D &
    SNEIR,LARRY &
    ALONSO,MERRIL M
    KIM,JIN SOO &
    HARRISON,GEORGE & NANCY
    LUKS,BARBARA VACCARO
    MILES,JAMIE & MARLON D
    LITT,JEFFREY D & LISA J

    Is there an excel calculation to get last, first, and middle initial (whether one character or several) in their own columns while getting rid of the "&" unless it's between two first names? So basically the "&" goes away if it's the very last character. Note that if there's two first names, then the "&" would stay and only the initial of righter most name would be split in own column.

    Thanks for any response

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: splitting first, last, middle initial in separate columns

    Hi,

    do a text to columns with a comma as the separator. That will leave you with two columns, the first one has the last name only.

    Next, do a text to columns on the second column, this time using the & as the delimiter.

    Now you'll have three columns, i.e. Last name, first name, spouse name

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

    Re: splitting first, last, middle initial in separate columns

    If we assume strings are in A1:An then based on the samples:

    Please Login or Register  to view this content.
    The above would return:

    Please Login or Register  to view this content.
    note per your requirements where multiple names and multiple middle name/initials only the right most is used


    Goes without saying that with more thought the above can be shortened significantly ... that said a UDF might still be preferable.
    Last edited by DonkeyOte; 10-12-2010 at 05:13 AM. Reason: duplicate formula posted by accident...

  4. #4
    Forum Contributor
    Join Date
    09-19-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2007
    Posts
    140

    Re: splitting first, last, middle initial in separate columns

    Thanks for replies.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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