+ Reply to Thread
Results 1 to 3 of 3

Splitting text

  1. #1
    Registered User
    Join Date
    03-15-2011
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    48

    Splitting text

    Hi I have written 2 formulas to split a single cell contents and it works up to a point. The problem I have is that the text entered, in this case a name, takes many different formats.

    Current formulas are as follows:-
    =UPPER(IF(ISERROR(FIND(" ",'Calc Sheet'!Q2,1)),LEFT('Calc Sheet'!Q2,FIND("",'Calc Sheet'!Q2,1)-1),LEFT('Calc Sheet'!Q2,FIND(" ",'Calc Sheet'!Q2,1)))) (for First Name)
    and
    =UPPER(IF(ISERROR(FIND(" ",'Calc Sheet'!Q2,1)),'Calc Sheet'!Q2,RIGHT('Calc Sheet'!Q2,LEN('Calc Sheet'!Q2)-FIND(" ",'Calc Sheet'!Q2,1)-0))) (for middle & last name)

    The data I have i each cell is as shown below.

    Miss Kelly Jones
    Dr V Smith
    Jane Brown
    Jennifer Linton Cook
    Mrs Brown.

    etc.

    I am trying to write a formula to split these various formats into 3 cells

    Title First Name Last name
    Miss Kelly Jones
    Dr V Smith
    Jane Brown
    Jennifer Linton Cook
    Mrs Brown

    Is there any way that this would be possible.

    Any help or guidance will be greatly appreciated

    Macke

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,585

    Re: Splitting text

    I would suggest two things: count the spaces and use a lookup function to determine if the first piece of text is recognised title. So, for example, if you have one space, it is either a title and surname or a first name and surname. If you have two spaces, it could be title, first name and surname or first name and double barrelled surname.

    Messy.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    03-15-2011
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: Splitting text

    Hi yes it is very messy. These are downloads from Amazon sales and it seems that they allow customers to load data any way they like. I have played around with vlookups against the the title, but it ain't very easy.

    Anyway thanks for your suggestion.

    Ken

+ 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