+ Reply to Thread
Results 1 to 7 of 7

Vlookup, Match (Search or Find) partial string within string in a Cell

  1. #1
    Valued Forum Contributor
    Join Date
    04-13-2011
    Location
    Ottawa, Canada
    MS-Off Ver
    365
    Posts
    1,067

    Vlookup, Match (Search or Find) partial string within string in a Cell

    Hello Excel Gurus/Experts,

    Below is the situation that I'm hoping you guys could help me out.

    String To Search String Result Original 'String'
    05DHAT123BLCA; 05DHCT234BLTH TC* 05QHDQ345 05QHDQ345TCOM; 05FIXX456BCLU
    05QHDQ345TCOM; 05FIXX456BCLU BL* 05DHAT123 05DHAT123BLCA; 05DHCT234BYTH

    Given the data, what formula should I use in order to give me the result shown?

    i.e. Look for TC* (where * is wild card) and then SEARCH the column in 'Striing' (in this case, it's 05QHDQ345 - NOTE that anything from TC onwards is deleted) give me the row of the data that has the string shown.
    Last edited by dluhut; 05-28-2013 at 12:25 PM.

  2. #2
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Vlookup, Match (Search or Find) partial string within string in a Cell

    What if you get two matches?
    CC


    If you feel really indebted please consider a donation to charity. My preferred charity is ActionAid but there are plenty of worthy alternatives.

  3. #3
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Vlookup, Match (Search or Find) partial string within string in a Cell

    Hi,

    Could do with a bit more information. In your example, the Result to be returned corresponding to a Search String of TC* is 05QHDQxxxTCOM; 05FIXXxxxBCLU.

    Is this to say that this is the only string in the list which contains that particular Search String? And does this apply to all of your strings, i.e. for each Search String there is precisely one String which contains that Search String?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  4. #4
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Vlookup, Match (Search or Find) partial string within string in a Cell

    Hi dluhut

    Perhaps something along these lines, assuming your data is in A1:B3. In C2 and copy down.

    =LOOKUP(20^20,SEARCH($B$2:$B$3,A2),$A$2:$A$3)

    Edit: I have removed the asterisks in B2:B3.
    Regards Kevin


    Merged Cells (They are the work of the devil!!!)

  5. #5
    Valued Forum Contributor
    Join Date
    04-13-2011
    Location
    Ottawa, Canada
    MS-Off Ver
    365
    Posts
    1,067

    Re: Vlookup, Match (Search or Find) partial string within string in a Cell

    Sorry folks...I missed the important step. I've edited.

    So the important step is, to search the remaining string and return the result from the original 'string'

  6. #6
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Vlookup, Match (Search or Find) partial string within string in a Cell

    The following approach works without asterisks, i.e. search string = TC:
    =INDEX($A:$A,MATCH(9E+99,FIND(C2,$A:$A)))
    Where C2 is the search string and A:A contains the first string. It will return the first result it finds.

    Enter with Ctrl + Shift + Enter. Done correctly, you get:
    {=INDEX($A:$A,MATCH(9E+99,FIND(C2,$A:$A)))}

  7. #7
    Valued Forum Contributor
    Join Date
    04-13-2011
    Location
    Ottawa, Canada
    MS-Off Ver
    365
    Posts
    1,067

    Re: Vlookup, Match (Search or Find) partial string within string in a Cell

    Thanks Cheeky...i replace the FIND with SEARCH and it gives me the result that I need.

    Reps up to you. Please check!

+ 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