+ Reply to Thread
Results 1 to 6 of 6

Need help with a string

  1. #1
    Registered User
    Join Date
    10-15-2012
    Location
    los angeles
    MS-Off Ver
    Excel 2003
    Posts
    3

    Need help with a string

    Victorian Ruffles Princess Dress in Purple<br><b>Size:</b>&nbsp;2<br><b>Color:</b>&nbsp;Purple

    I need a function where I could extract the "Size:", but I only want 2 to come out for all. It's basically a description. I want to separate sizes from all my descriptions. Basically, I want a function that can help me determine the size from the description string.
    Last edited by aznj50; 10-15-2012 at 05:51 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: Need help with a string

    If your string is on cell A1, then try this formula...

    =MID(A1,SEARCH("Size",A1)+15,SEARCH("<br>",A1,SEARCH("Size",A1))-SEARCH("Size",A1)-15)

    It's not pretty, but it just might work...

  3. #3
    Registered User
    Join Date
    10-15-2012
    Location
    los angeles
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Need help with a string

    it didn't work. ughh. It's in column F2 though, i replaced all the A1 with F2 still didn't work.

  4. #4
    Registered User
    Join Date
    10-15-2012
    Location
    los angeles
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Need help with a string

    "Victorian Ruffles Princess Dress in Purple Size: 2 Color: Purple" is the text and only want the size to come out from the result forumula.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Need help with a string

    if there will always be a ; in front of the number and < after it, try this ugly beast...
    =MID(F1,SEARCH(";",F1,1)+1,SEARCH("<",F1,SEARCH(";",F1,1))-SEARCH(";",F1,1)-1)

    this will allow for 2 or 20 or 200 etc

    edit:
    looking at your last post - are youy saying now that all the control codes are NOT in that text? then use this instead

    =MID(F2,FIND(": ",F2,1)+1,FIND(" Color:",F2,1)-FIND(": ",F2,1))
    Last edited by FDibbins; 10-15-2012 at 07:53 PM.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: Need help with a string

    Oops, I took into effect the html code... HA!

    If the string is on F2, then in G2, type this formula...
    =VALUE(MID(F3,SEARCH("Size:",F3)+6,SEARCH("Color",F3,SEARCH("Size:",F3))-SEARCH("Size:",F3)-6))

+ 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