+ Reply to Thread
Results 1 to 7 of 7

Can a Partial Search Array Formula for Multiple return values be looped?

  1. #1
    Registered User
    Join Date
    10-18-2016
    Location
    Calgary, Canada
    MS-Off Ver
    2010
    Posts
    5

    Question Can a Partial Search Array Formula for Multiple return values be looped?

    Hi! First time poster here. I’ve read through some threads on these forums which have helped me before (Thanks!) but I couldn’t find a solution to my current dilemma, I've been fighting with this issue all day and hoping maybe someone could give me a hand.

    I have 2 sets of data I am trying to compare, which will give me multiple returns. My goal is to get a list of the all 3 fields (Document Number, Project, and Filename) on one spreadsheet. (See attachment please)

    Sheet 1: Contains the Document Number that ends up being a partial value (search parameter)
    Sheet2: Contains the Project and Filenames (filenames contain the document number and random characters) I have to reference
    Sheet 3: Needs to show the Document Number, Project #, and associated Filename

    Array Formula is as follows in C2 (to find the corresponding filenames):
    =INDEX(Sheet2!$B$2:$B$23,SMALL(IF(ISNUMBER((SEARCH(Sheet1!$A$2,Sheet2!$B$2:$B$23))),ROW(Sheet2!$B$2:$B$23)-MIN(ROW(Sheet2!$B$2:$B$23))+1,""),ROW(A1)))
    Array Formula in B2 (to find the corresponding project):
    =INDEX(Sheet2!$A$2:$A$23,SMALL(IF(ISNUMBER((SEARCH(Sheet1!$A$2,Sheet2!$B$2:$B$23))),ROW(Sheet2!$B$2:$B$23)-MIN(ROW(Sheet2!$B$2:$B$23))+1,""),ROW(A1)))

    This lets me find all “Filename” items in Sheet2 with the “Document Number” in it and lists it, along with the project, in Sheet 3. However, how would I get the next “Document Number” in Sheet1 to become the search parameter when the return is #NUM? Until all the “document numbers” in Sheet1 are depleted?

    I’ve tried the following and a few variations of it, which doesn’t work. =ISERROR(INDEX(Sheet2!$B$2:$B$23,SMALL(IF(ISNUMBER((SEARCH(Sheet1!$A$2,Sheet2!$B$2:$B$23))),ROW(Sheet2!$B$2:$B$23)-MIN(ROW(Sheet2!$B$2:$B$23))+1,""),ROW(A1))), =INDEX(Sheet2!$B$2:$B$23,SMALL(IF(ISNUMBER((SEARCH((Sheet1!$A$2+ROW()+1),Sheet2!$B$2:$B$23))),ROW(Sheet2!$B$2:$B$23)-MIN(ROW(Sheet2!$B$2:$B$23))+1,""),ROW(A1))))

    And then on top of that I also need to figure out how to add the “Document Number”(partial value) from Sheet1 into ColumnA in Sheet3 in direct correlation to the value in ColumnC Sheet3.

    I may be doing it backwards, and if so, someone please point it out. Maybe I should put all this in a macro instead?

    Disclaimer: This is a small sample, this is actually list of 5000+ files.

    Thanks for any help you can provide. Sorry if it’s a convoluted post, I’m brain dead at the moment.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Can a Partial Search Array Formula for Multiple return values be looped?

    Hello RiChCh,

    I prefer VBA to formulas...
    Here's a suggestion for your :

    Please Login or Register  to view this content.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  3. #3
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,362

    Re: Can a Partial Search Array Formula for Multiple return values be looped?

    Pergaps something like this? Iam using helper columns on sheet2
    Attached Files Attached Files

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,165

    Re: Can a Partial Search Array Formula for Multiple return values be looped?

    Hi RiChCh and welcome to the forum,

    This looks like an Advanced Filter problem where you use your sheet 1 numbers in a wildcard search on the second sheet. See the attached and learn a bit more about Advanced Filters and Wildcard searches.

    Adv Filter using Wildcards.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  5. #5
    Registered User
    Join Date
    10-18-2016
    Location
    Calgary, Canada
    MS-Off Ver
    2010
    Posts
    5

    Re: Can a Partial Search Array Formula for Multiple return values be looped?

    Quote Originally Posted by azumi View Post
    Pergaps something like this? Iam using helper columns on sheet2
    Thanks Azumi,

    I kind of see what you did here, and it works for this example. However my actual data contains alphas as well so I don't think this would work in that situation.

    Richch

  6. #6
    Registered User
    Join Date
    10-18-2016
    Location
    Calgary, Canada
    MS-Off Ver
    2010
    Posts
    5

    Re: Can a Partial Search Array Formula for Multiple return values be looped?

    Quote Originally Posted by GC Excel View Post
    Hello RiChCh,

    I prefer VBA to formulas...
    Here's a suggestion for your :

    Please Login or Register  to view this content.
    Thanks GC.

    This worked! I admit my ignorance at how the VBA coding works, so I have no clue how it works! lol

    Quick question, if I wanted to add a column for version in column B !Sheet1, how could we go about adding this info to the VBA macro?
    Also, it adds the information into columns E-G, is this due to the part I highlighted? It doesn't matter really, as all I need is the output, just curious.

    Thanks,
    Richch

  7. #7
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Can a Partial Search Array Formula for Multiple return values be looped?

    1)
    How would the new column B in sheet 1 relate to the data in sheet 2? Can you provide example.

    2)
    Yes, output is in E-G because of what you highlighted. I didn't want to write over your data.
    simply change the number to 1, 2, 3 respectively
    Cells(n, 5) means Cell(row N, column 5)

+ 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] Array formula to return list of values that match multiple criteria
    By TFiske in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-30-2016, 01:57 PM
  2. Array formula to return multiple values based on various (OR) criteria
    By dancing-shadow in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-20-2013, 05:12 AM
  3. [SOLVED] ARRAY Formula to return multiple values
    By Ricardo Mass in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-01-2013, 01:55 PM
  4. Need to search array and return value along with title and row values
    By wilburr in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-28-2013, 06:01 AM
  5. [SOLVED] need to do Partial name search and return the value against the partial name
    By Kiran Kurapati in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-09-2013, 09:40 AM
  6. Lookup multiple partial match conditions and return values
    By darklans in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 04-18-2012, 03:26 AM
  7. Formula / array to return multiple values
    By paulmag in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-03-2008, 11:52 AM

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