+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    03-05-2010
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    2

    Red face Removing the end of text string

    Hi

    I am trying to create a formula allowing me to automatically shorten the content of cells containing names and codes, to show the name only:

    Before: George Washington - D3405

    Desired: George Washington

    I.e. I want to cut from the end of the family name, regardless of lenght of ending code. Have tried a couple of the tips in FAQ but did not get anywhere - even thought they tips appeared very relevant. Pls help

  2. #2
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,139

    Re: Removing the end of text string

    If there is consistently a dash separating the 2 items, then

    =Trim(Left(A1;Find("-";A1)-1))

    where A1 contains the string.

    EDIT: delimiter modified to ; from ,
    Last edited by DonkeyOte; 03-05-2010 at 12:10 PM.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    03-05-2010
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Removing the end of text string

    Dear NBVC,

    Thanks for help. It works beautifully!

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.2.0