+ Reply to Thread
Results 1 to 3 of 3

Formula for taking out words in cell required

  1. #1
    Registered User
    Join Date
    11-01-2006
    Posts
    45

    Formula for taking out words in cell required

    Hi,

    Can anyone hlep with this. I have a list of cells some of which just have a name and some have a name then a hyphen and some letters and numbers.

    Basically I need a formula that will allow me to take out whatever is typed after the hyphen and if possible to replace it with another letter.

    ie, on sheet just now I have info like this in the column:
    abc
    abcfd - df1
    abcb - df2
    abcs

    And I need this displayed as:
    abc / TM
    abcfc / TM
    abcb / TM
    abcs / TM

    The amount of letters in the list changes but the letters I want to replace the hyphen and details with will always be the same ie TM. Even if I need to do this over two columns, to remove the hyphen and details then somehow ad on the forward slash TM after whatever is written there.

    Hope this makes sense.

  2. #2
    Forum Expert
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500
    If the data is always as in your example, so there is always a space after the intital text string, or is it blank the following should work if the data is in A1

    =IF(ISERROR(SEARCH(" ",A1)),A1,LEFT(A1,SEARCH(" ",A1)-1))&" / TM"

    However if other combinations such as abc-df2 occur it will fail, but as you have not given them in your example, hopefully this is not the case

    Regards

    Dav

  3. #3
    Registered User
    Join Date
    11-01-2006
    Posts
    45
    The data is sometimes words with spaces in the before the hyphen, however, I just replaced the space in your formula with a hyphen and it gives me the full string of words i require followed by / TM.

    Thanks a lot, saves me lots of time!

+ 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