+ Reply to Thread
Results 1 to 12 of 12

Extract from String using Wildcard

  1. #1
    Registered User
    Join Date
    05-07-2009
    Location
    Singapore But in China now
    MS-Off Ver
    Excel 2007
    Posts
    25

    Extract from String using Wildcard

    Hi All,

    I've this question, how do i extract a part of the text using wildcard(example "ID=") in the string in the whole columns and copy to other columns or delete the unwanted.

    Below is a example which i create for better understanding.

    Thanks alot.
    Attached Files Attached Files
    Noobie here to LEARN

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Extract from String using Wildcard

    Hi,
    perhaps something like =RIGHT(A11;LEN(A11)-FIND("=";A11;1)) ( replace ; with , if needed)

  3. #3
    Registered User
    Join Date
    05-07-2009
    Location
    Singapore But in China now
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Extract from String using Wildcard

    Quote Originally Posted by arthurbr View Post
    Hi,
    perhaps something like =RIGHT(A11;LEN(A11)-FIND("=";A11;1)) ( replace ; with , if needed)
    I'm very sry but i'm kinda noob when do i paste this? in VBA?

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Extract from String using Wildcard

    Hi,
    have a look at the attached file
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    04-03-2007
    Location
    Auckland, New Zealand
    MS-Off Ver
    2007
    Posts
    137

    Re: Extract from String using Wildcard

    Hi,
    I had a similar (I think) problem recently -
    Someone had extracted a list of Usernames from an application
    The result was a single column of strings, with each cell having multiple Usernames.
    Each Username was prefixed with "CN=" and suffixed with a comma
    Unfortunately the strings were of varying length and the number of usernames in each string also varied.
    The strings also contained other information.
    Converting from Text to Columns didn't work as some of strings had enough commas to exceed the number of columns available (xl2003)

    So..
    The below looks within a string for instances of the first criteria ("CN=") then look for the first comma after finding "CN=", trims the criteria (both fore and aft) and pastes the value the string between the criteria in a cell 10 rows below the block of strings.
    Then continues to scan the string, etc, etc until is gets to the end of the string then drops down the next row and starts again.

    Hope this helps - I couldn't find a formulaic solution to this.


    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    05-07-2009
    Location
    Singapore But in China now
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Extract from String using Wildcard

    What arthurbr gave me actually works the way i want it but my problem is the Strings has more den one "="

    I try

    =IF(ISTEXT(FIND("=",A64,1)),RIGHT(A64,LEN(A64)-FIND("=",A64,1)),"") = No luck.


    Can we like add one code to extract after the last "=" or extract after the text(Example "ID=")?

    I just notice the second problem using funcation i can't copy the value haha.. <- Big problem! lolz..
    Anyway arthurbr thank alot
    Last edited by whousedmy; 05-14-2009 at 05:37 AM.

  7. #7
    Forum Contributor
    Join Date
    04-03-2007
    Location
    Auckland, New Zealand
    MS-Off Ver
    2007
    Posts
    137

    Re: Extract from String using Wildcard

    Umm..

    =RIGHT(MID(A11,FIND("ID=",A11,1),(LEN(A11)-FIND("ID=",A11,1)+1)),(LEN(MID(A11,FIND("ID=",A11,1),(LEN(A11)-FIND("ID=",A11,1)+1)))-3))

    works

    Just gets anything to the right of "ID="

  8. #8
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Extract from String using Wildcard

    See attached for an example with more than one "=".
    It can be done without helper column F but the formula would probably be unreadable.

    ( Also, it is better to post an xls file than a xlsx file. As everybody does not have 2007 or the converter, your chances of being help will increase dramatically)
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    05-07-2009
    Location
    Singapore But in China now
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Extract from String using Wildcard

    So sorry abt the 2007 issue I'll take note next.. I'm still unable to copy the value when i copy to another sheet it just show a blank cell with the formula.
    Last edited by whousedmy; 05-14-2009 at 07:58 AM.

  10. #10
    Registered User
    Join Date
    05-07-2009
    Location
    Singapore But in China now
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Extract from String using Wildcard

    Quote Originally Posted by whousedmy View Post
    So sorry abt the 2007 issue I'll take note next.. I'm still unable to copy the value when i copy to another sheet it just show a blank cell with the formula.
    Ah.. I'm so sry.. i got it.. i need to paste speical and select values.. thanks lot!

  11. #11
    Registered User
    Join Date
    05-07-2009
    Location
    Singapore But in China now
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Extract from String using Wildcard

    Quote Originally Posted by arthurbr View Post
    See attached for an example with more than one "=".
    It can be done without helper column F but the formula would probably be unreadable.

    ( Also, it is better to post an xls file than a xlsx file. As everybody does not have 2007 or the converter, your chances of being help will increase dramatically)
    I still can't get it wat if it's like link is like this

    =2&taskId=135&swItem=MTX-f8f544db083eXXX

    What i need is MTX-f8f544db083eXXX

    I'm truly sry if i didn't make myself clear just now..

  12. #12
    Registered User
    Join Date
    05-07-2009
    Location
    Singapore But in China now
    MS-Off Ver
    Excel 2007
    Posts
    25

    Thumbs up Re: Extract from String using Wildcard

    I still can't get it wat if it's like link is like this



    =2&taskId=135&swItem=MTX-f8f544db083eXXX



    What i need is MTX-f8f544db083eXXX



    I'm truly sry if i didn't make myself clear just now..


    =IFERROR(RIGHT(A12,LEN(A12)-FIND("ID=",A12,1)-6),"")



    I would like to thanks EVERYONE for the help but this is the final ans and i also believe tat actually all the ans is correct just tat i don't know how to apply therefore THANKs to everyone!

+ 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