+ Reply to Thread
Results 1 to 8 of 8

How to find a string within another list of strings?

  1. #1
    Registered User
    Join Date
    11-16-2012
    Location
    United States
    MS-Off Ver
    Mac Excel 2011
    Posts
    8

    How to find a string within another list of strings?

    Hello,

    Can someone help me with this?

    I want to be able to search for a list of strings against another list of strings and return True/False, or the sought value--doesn't really matter here. The list that I'm searching for is a list of Internet domains(5-20 characters). The list that i'm searching against is a list with strings containing anywhere from 10 to 1500 characters (in each string).These strings are made up of internet domains separated by "|". I can replace these with commas if necessary. In addition, the list i'm searching against is about 20,000 lines and growing.

    The current formula, which was was written for me by my employer, seems to break after string that we're looking up against exceeds a certain length. So as a way I've been coping with this is manually using the Find, Ctrl-F, function and looking for the value of interest that way. Takes me forever to get my work done doing this...

    Any feedback would be greatly appreciated!!!

    Sincerely,
    Matt

  2. #2
    Forum Contributor satputenandkumar0's Avatar
    Join Date
    11-08-2012
    Location
    Pune, India
    MS-Off Ver
    Office xp & Office 2007
    Posts
    398

    Re: How to find a string within another list of strings?

    Dear Matt,

    pls give the example file.

    Regards,
    Nandu Satpute

  3. #3
    Registered User
    Join Date
    11-16-2012
    Location
    United States
    MS-Off Ver
    Mac Excel 2011
    Posts
    8

    Re: How to find a string within another list of strings?

    Sorry about that. Here it is

    There are two sheets, Dump and Domains. I basically want to find if any of the values in [domains] match that within [dump]. Particularly, Column C in [Dump], and column A in [Domains]


    Thanks!
    Attached Files Attached Files
    Last edited by lmattenl; 11-16-2012 at 01:44 AM.

  4. #4
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: How to find a string within another list of strings?

    try this one in cell B1 (Domain)

    =IF(IFERROR(MATCH("*"&Domains!A1&"*",Dump!$C:$C,0),FALSE),TRUE)

    or if you want to return column B of (DUMP)

    =IFERROR(INDEX(Dump!$B:$B,MATCH("*"&Domains!A1&"*",Dump!$C:$C,0)),"")
    Last edited by vlady; 11-16-2012 at 02:19 AM.
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  5. #5
    Forum Contributor satputenandkumar0's Avatar
    Join Date
    11-08-2012
    Location
    Pune, India
    MS-Off Ver
    Office xp & Office 2007
    Posts
    398

    Re: How to find a string within another list of strings?

    try below formula

    =IF(IFERROR(MATCH("*"&Domains!A1&"*",Dump!$C:$C,0),FALSE),TRUE)

  6. #6
    Registered User
    Join Date
    11-16-2012
    Location
    United States
    MS-Off Ver
    Mac Excel 2011
    Posts
    8

    Re: How to find a string within another list of strings?

    Hi,
    I really appreciate both your help, however, i have two issues. The first is that the formulas are still unable to capture instances where the lookup String is very long (>200 Characters)

    I used the formulas and found two examples of this issue for domains:
    nissan.nl
    dodge.ca

    These two domains belong in a very long string in (dump). Is this a limitation of excel? why is it unable to capture this? if i use a ctrl-F, it finds it just fine (so my thinking is that there must be a way to capture this!

    The second concern I want to ask you guys...is there a way to find an exact match separated by the commas or bars (|)? For example, the formula will find bug.com in various instances i.e. deadbug.com, happybug.com, lifeofbug.com. What happens on my end is that since i see that it found bug.com, i'll delete it since i don't want the duplicate, when in fact, bug.com does not exist in my original file?

    You have already been so much help. Currently i use 5 different formulas to achieve the same thing...you guys helped me bring it down to one!! WHOOO!

    Again, I appreciate the help, hope to hear back soon :-)

    Matt

  7. #7
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: How to find a string within another list of strings?

    don't know why the index/match didn't return the correct value the sumproduct did.

    =IF(SUMPRODUCT(--ISNUMBER(FIND(A1,Dump!$C$2:$C$17607)))=1,TRUE,FALSE)

  8. #8
    Registered User
    Join Date
    11-16-2012
    Location
    United States
    MS-Off Ver
    Mac Excel 2011
    Posts
    8

    Re: How to find a string within another list of strings?

    Vlady, you rock my world...Thank you very much!

    Now I have one last question, which may be just laziness asking...but I want to learn how to fish (metaphorically) what's a good starting point to become a spreadsheet guru? I want to be able to confront novel situations and be able to find solutions. This would take an understanding at the deepest levels--how the formulas function, how excel even makes the calculation....How did you get a such a deep grasp on excel? Did you just start by looking at formulas and thinking of clever ways to use them? did you break down formulas to see how the function? Did you read a book, take a class? Can anyone recommend any textbooks, or good starting points?


    I once read a great quote which said something like, "If you don't know where you are going, any path will get you there."...which is exactly what I intend to do, but guidance would be nice

    Thank you!
    Matt

+ 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