+ Reply to Thread
Results 1 to 5 of 5

Extract Characters

  1. #1
    Registered User
    Join Date
    02-18-2013
    Location
    culeeu daet
    MS-Off Ver
    Excel 2003
    Posts
    2

    Extract Characters

    Hi all..

    I've read over quite a few posts that are very close/similar to what I need, but not having much luck finding an exact match!

    I have a column with data formatted like this:

    nails - short - batch12 - 2013
    hammer - tier2 - inventory - 2000
    screws - wh - local - order

    I need to extract the data before the second hyphen (-). So my results would look like:

    nails - short
    hammer - tier2
    screws - wh

    I really prefer to use a formula. Any help would be greatly appreciated.

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Extract Characters

    Try

    Please Login or Register  to view this content.
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Extract Characters

    If your first row of data was in cell A2 then:

    =TRIM(LEFT(A2,FIND("~",SUBSTITUTE(A2,"-","~",2))-1))

    Coped down

  4. #4
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Extract Characters

    =MID(E12,1,FIND("-",E12,FIND("-",E12,1)+1)-1)

    Where the splitting data is in E12

  5. #5
    Registered User
    Join Date
    02-18-2013
    Location
    culeeu daet
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Extract Characters

    Thank you!

+ 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