+ Reply to Thread
Results 1 to 10 of 10

HELP: spliting a string

  1. #1
    Registered User
    Join Date
    12-02-2013
    Location
    israel
    MS-Off Ver
    2007
    Posts
    4

    HELP: spliting a string

    Hi all,

    Can anyone tell me the formula to split the a6439d01m,a2638dm,a8399em....from the string

    I have this kind of strings:

    http://www.greenturtle.com/images/op..._a6439d01m.jpg
    http://www.greenturtle.com/images/op...ts_a2638dm.jpg
    http://www.greenturtle.com/images/op...ts_a8399em.jpg
    ......
    ......

    I need to split this a6439d01m from the string

    Thanks

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: HELP: spliting a string

    You can't see the full string on the forum, but it appears that the part you want is preceded by an underscore, and then followed by .jpg, so if the first string is in A1 and there is only one underscore you can try this:

    =MID(A1,FIND("_",A1)+1,LEN(A1)-FIND("_",A1)-4)

    then copy this down.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    12-02-2013
    Location
    israel
    MS-Off Ver
    2007
    Posts
    4

    Re: HELP: spliting a string

    Hi pete,

    Thanks for your help but the result of you formula is return this answer: black_men_tshirts_a11001a01m

    .../images/options/*******-t-shirt_black_men_tshirts_a11001a01m.jpg

    and I need just: a11001a01m

  4. #4
    Forum Contributor
    Join Date
    07-02-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    197

    Re: HELP: spliting a string

    If you want to split into two cells then use Text to columns from the Data menu. Chose delimeter as Other and type an underscore in the box.

    Then you do the same with the new B column and chose dot as delimeter.
    Last edited by Rambo4711; 12-02-2013 at 10:46 AM.

  5. #5
    Registered User
    Join Date
    12-02-2013
    Location
    israel
    MS-Off Ver
    2007
    Posts
    4

    Re: HELP: spliting a string

    I don't want to split into two cells, i just need the number with the letters, like a11001a01m

    let say that the string is in A1 and i need to cut just "a11001a01m" from the string
    i don't need this "_black_men_tshirts"

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: HELP: spliting a string

    You can try this:

    =MID(A1,FIND("s_",A1)+2,LEN(A1)-FIND("s_",A1)-5)

    Might not work for all strings.

    Hope this helps.

    Pete

  7. #7
    Forum Contributor
    Join Date
    07-02-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    197

    Re: HELP: spliting a string

    Quote Originally Posted by gtben View Post
    I don't want to split into two cells, i just need the number with the letters, like a11001a01m

    let say that the string is in A1 and i need to cut just "a11001a01m" from the string
    If you use Text to column as my suggestion you will have the first part in column A and the cut information you wanted in column B. The remaining .jpg will be in column C. But if you want the full string to be intact, you cannot use Text to columns.

  8. #8
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: HELP: spliting a string

    Formula in B1 and copy it down

    =LEFT(TRIM(RIGHT(SUBSTITUTE(A1,"_",REPT(" ",255)),255)),LEN(TRIM(RIGHT(SUBSTITUTE(A1,"_",REPT(" ",255)),255)))-4)


    A
    B
    1
    http://www.greenturtle.com/images/op..._a6439d01m.jpg a6439d01m
    2
    http://www.greenturtle.com/images/op...ts_a2638dm.jpg a2638dm
    3
    http://www.greenturtle.com/images/op...ts_a8399em.jpg a8399em
    4
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  9. #9
    Registered User
    Join Date
    12-02-2013
    Location
    israel
    MS-Off Ver
    2007
    Posts
    4

    Re: HELP: spliting a string

    Hi AlKey,

    Thanks a lot!!! it works like a magic!
    You are the best!

  10. #10
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: HELP: spliting a string

    You're welcome. Don't forget to thank those who helped by clicking on Add Reputation * and please mark thread as "Solved" if your issue has been resolved. (Selecting Thread Tools-> Mark thread as Solved).

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Spliting Portuguese Address String into three cells
    By Dabbot in forum Excel General
    Replies: 1
    Last Post: 08-03-2012, 04:46 PM
  2. Spliting the data
    By devesh.agrawal in forum Excel General
    Replies: 11
    Last Post: 04-04-2009, 03:05 AM
  3. Spliting a name cell
    By rachew in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-20-2007, 06:56 AM
  4. Spliting data
    By blander in forum Excel General
    Replies: 3
    Last Post: 07-26-2006, 12:44 PM
  5. spliting text
    By sungen99 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-02-2006, 09:40 AM

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.6.0 RC 1