+ Reply to Thread
Results 1 to 6 of 6

Search Against Array w/ Wildcards and Secondary Output Column?

  1. #1
    Registered User
    Join Date
    02-18-2011
    Location
    No, Thank You
    MS-Off Ver
    Excel 2003
    Posts
    30

    Search Against Array w/ Wildcards and Secondary Output Column?

    I may not be explaining this well, but here's what I'm working with:

    2m1j7XX.jpg

    And what I need to do is, for every cell in the Entry column, search through the Token column for a match (obviously wildcards will be required), and if one is found, spit out the corresponding cell in the Output column. I've spent the last 30 minutes looking for a proper solution. It's probably something simple, but I can't get INDIRECT/SEARCH to work with both an array and wildcards to compensate for not having direct matches to work with.

    Let me know if that isn't clear, my find product would be the Entry columns with the appropriate values from the Output column, based on what the search found (if anything) in the Token column.

  2. #2
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Search Against Array w/ Wildcards and Secondary Output Column?

    This is possible:

    A
    B
    C
    D
    1
    Token Output Entry
    2
    Cat ABC CAT XYZ =VLOOKUP("*"&A2&"*",$D$2:$D$4,1,0) ABC DOG XYZ
    3
    Dog ABC DOG XYZ ABC BIRD XYZ
    4
    Bird ABC BIRD XYZ ABC CAT XYZ


    This returns the value in column D. If you want another response, wrap the formula in an IF statement like this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Substitute the text with what you want.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  3. #3
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Search Against Array w/ Wildcards and Secondary Output Column?

    Hi an_otter,

    Try something like this:
    Please Login or Register  to view this content.
    The 'like' commands uses 'regular expresssions' with a twist. In the debugger, double click on 'like', and then press 'f1' to get more information about the 'like' command.

    Lewis

  4. #4
    Registered User
    Join Date
    02-18-2011
    Location
    No, Thank You
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Search Against Array w/ Wildcards and Secondary Output Column?

    Quote Originally Posted by newdoverman View Post
    This is possible:

    A
    B
    C
    D
    1
    Token Output Entry
    2
    Cat ABC CAT XYZ =VLOOKUP("*"&A2&"*",$D$2:$D$4,1,0) ABC DOG XYZ
    3
    Dog ABC DOG XYZ ABC BIRD XYZ
    4
    Bird ABC BIRD XYZ ABC CAT XYZ


    This returns the value in column D. If you want another response, wrap the formula in an IF statement like this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Substitute the text with what you want.
    I know this seems like the logical approach, I did the same, but I need this in reverse. So the C column in your example needs to spit out the B values associated with the A range, which is parsed through for each entry in D. If that makes sense. I'd need to parse through column A for each entry in column D to see if there's a match, and if there is, the output needs to be whatever's in column B.

  5. #5
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Search Against Array w/ Wildcards and Secondary Output Column?

    The formula shown is what is actually in column B. For what you want to appear in column B for a match, substitute the "Found" part of the formula with what you want to appear when there is a match. If you want a blank cell when there isn't a match change the "Not Found" to simply "".

    The contents of column C as you see it is just showing you the formula that is in column B.

    If you need a value to the right of the values in column D change the formula to:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The 2 near the end of the formula says to look in the next column over which would be column E, if what you want is in column F the 2 should be 3.
    Last edited by newdoverman; 04-01-2014 at 09:15 PM.

  6. #6
    Registered User
    Join Date
    02-18-2011
    Location
    No, Thank You
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Search Against Array w/ Wildcards and Secondary Output Column?

    That doesn't exactly fit my need, since I'm not looking to see if each entry in list A exists in list D, I'm looking to see if each entry in list D contain any entry in list A, and then provide the neighbouring entry in list B if found.

    As an example of what I'd need to provide the output I require (this doesn't work):

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    And so on. So I need to search the entire column A for a value that may exist in each cell of column D, and if one is found, the output is the entry next to it in column B.

    I apologize if I'm not making this clear, Google doesn't get what I need, either.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Search Column for Repeat values and output
    By cp41 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-06-2013, 03:44 PM
  2. Formula to search column for match and output date in corresponding row
    By bpartin13 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-22-2013, 12:52 AM
  3. [SOLVED] Search a text in an array and gives a corresponding output.
    By krash297 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-30-2013, 07:37 AM
  4. Search A Cell And Output A Result From An Array
    By JonnyBoy333 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-03-2011, 08:24 AM
  5. search column and output results in new worksheet in a different o
    By Paul in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-19-2006, 02:50 PM

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