+ Reply to Thread
Results 1 to 7 of 7

Formula needed to retrieve name only

  1. #1
    Registered User
    Join Date
    10-28-2010
    Location
    UK, Swansea
    MS-Off Ver
    Excel 2010
    Posts
    64

    Formula needed to retrieve name only

    Hi,
    I receive a roll call of names where the name is followed by a bracket or hyphen and a number, or both. I need to extract the name only in a separate column.
    Can someone please be so kind and assist me with a formula to do this. Examples are shown in the attachment.
    Many thanks in anticiaption
    Mikey
    Attached Files Attached Files

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

    Re: Formula needed to retrieve name only

    how are you meant to distinguish between these two

    SIMON DAVIES -23

    RYAN SHAWCROSS-JAMES (32-67)
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Contributor
    Join Date
    08-23-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    163

    Re: Formula needed to retrieve name only

    Hi...This may help

    =LEFT(E3,(IFERROR(SEARCH("(",E3)-1,(SEARCH("-",E3)-1))))

  4. #4
    Registered User
    Join Date
    10-28-2010
    Location
    UK, Swansea
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: Formula needed to retrieve name only

    Have checked my full list and there are only three people with hyphens in their names, so will take out the hyphen manually. Is this what you mean or is there a problem in distinguishing between the hyphen and the bracket.

  5. #5
    Registered User
    Join Date
    10-28-2010
    Location
    UK, Swansea
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: Formula needed to retrieve name only

    Hi, have marked thread as solved but when I input into my full list I have a slight problem in that new recruits have not as yet been allocated a number so they are name only. These now appear as #value in my second column. How can I change this.
    Rgds
    Mikey

  6. #6
    Forum Contributor
    Join Date
    08-23-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    163

    Re: Formula needed to retrieve name only

    oh...sorry, i didnt considered the case of "names only", use the below revised formula

    =(IFERROR(LEFT(E3,(IFERROR(SEARCH("(",E3)-1,(SEARCH("-",E3)-1)))),E3))

    Let me know if this works

  7. #7
    Registered User
    Join Date
    10-28-2010
    Location
    UK, Swansea
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: Formula needed to retrieve name only

    Thanks works superbly. Should have put in the names only in the first instance. Thanks
    for coming back to the thread even after I had put solved.
    Very much appreciated
    Mikey

+ 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