+ Reply to Thread
Results 1 to 5 of 5

search for a part of string within an array of strings from another array list

  1. #1
    Registered User
    Join Date
    05-11-2011
    Location
    denver,co
    MS-Off Ver
    Excel 2007
    Posts
    2

    Question search for a part of string within an array of strings from another array list

    Hello
    i have an issue where i am trying to search for a part of text string within an array of strings from another array string list. For example in column A i might have

    Walmart
    Honda
    TVA
    Redstone arsenal
    BASF
    HCS-Hoover
    Safeway
    Google
    3M Building 278 - 3M Center - St. Paul
    3M - Building 255 - 3M Center - St Paul
    84 Lumber 601 (IL)
    3M - Cottage Grove - Cottage Grove, MN
    Accenture - All Locations
    Accenture - All Locations
    Aera Energy - Bakersfield 29235 (CA)
    ADT Security 2720 (AZ)

    column B i have items i want to find in column A but they are generally a subset of whats in A.

    3M
    84 lumber
    Accenture
    ADT - Tyco
    Aera energy

    So i want to be able search the entire list in A with the Entries in the B array and come back and say "yes" it found it or no it didnt. I have tried some search,find and index functions but i keep getting !VALUE errors or the wrong results. What is the right way to do this?

    thanks

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: search for a part of string within an array of strings from another array list

    Put this formula in C1 and copy down:

    =COUNTIF($A:$A, "*" & $B1 & "*")>0
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    05-11-2011
    Location
    denver,co
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: search for a part of string within an array of strings from another array list

    thank you for that. that does work, but i dont think i asked the right question exactly. The formula you provided does tell me if the items in B show up in A. But, i want to know if anything in B, shows up in each in anything in A. Since i have more items in A than i do in B, this current formula doesnt really do what I need it to. Does that make sense? Sorry for the confusion, i didnt convey it correctly the first time.

    Also, if i wanted to search using the above criteria but only say match up only the first few letters of A with whats in B, how would do that also?

    thank you

  4. #4
    Forum Contributor
    Join Date
    02-19-2005
    Location
    Gurgaon,India
    MS-Off Ver
    2007,2010,2013
    Posts
    180

    Re: search for a part of string within an array of strings from another array list

    Hi,

    may be...

    =LOOKUP("zzzzz",CHOOSE({1,2},"Not Found",LOOKUP(0,-SEARCH(B1,$A$1:$A$16),$A$1:$A$16)))
    Kris

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: search for a part of string within an array of strings from another array list

    Instead of "explaining", post a workbook showing us all of this. Column A, Column B, then manually mockup what you're trying to achieve for results.

    Click GO ADVANCED and use the paperclip icon to post up a copy of your workbook.

+ 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