+ Reply to Thread
Results 1 to 10 of 10

Help searching through multiple tables to pull data into a specific table

  1. #1
    Registered User
    Join Date
    03-05-2012
    Location
    Chicago
    MS-Off Ver
    2007
    Posts
    25

    Help searching through multiple tables to pull data into a specific table

    Sorry if my title isn't exactly specific; I wasn't really sure how to succinctly state my problem.

    Here's an example of what I'm working with:
    Example3.xlsx

    Basically, I have a list of items on the left where the user can input the vendor code for the preferred vendor to buy from. Based on that, I want the sheet to automatically populate the AS PURCHASED UNITS table by pulling the information from the correct vendor table. I have no clue how to go about this. Currently I'm setting it up as a series of IF statements (since there's only a handful of current vendors that I need to work with) but as more vendors are added IF statements will get incredibly messy and be a pain to adjust with each new vendor. The second sheet in the example is how the vendor part of the drop-down lists are set up (if that helps). The Preferred Vendor column draws from the vendor code list on the drop-down sheet.

    I'm not averse to using macros/VB, as long as it would automatically update as more vendors are added (or would update with a button click).

    Any help would be greatly appreciated.
    Last edited by Cyali; 03-15-2012 at 08:37 PM.

  2. #2
    Registered User
    Join Date
    05-13-2010
    Location
    Kozhikode, Keral, India
    MS-Off Ver
    Microsoft Office home and student 2019
    Posts
    49

    Re: Help searching through multiple tables to pull data into a specific table

    HI Cyali,
    I dnt seem to understand the problem fully.
    Correct me where i am wrong.......
    1. You have, at the moment 3 vendors.
    2. The user selects the preferred vendor via drop down in the range b7:b11 in sheet 1.
    3. Based on the above you want the range d7:k11 to automatically populate.

    Now I want to know that...
    1. There are 5 items under each vendor, so if a user selects vendor1 which item should the auto populated table show for the selected vendor.
    Best Regards
    Chandrajit

  3. #3
    Registered User
    Join Date
    03-05-2012
    Location
    Chicago
    MS-Off Ver
    2007
    Posts
    25

    Re: Help searching through multiple tables to pull data into a specific table

    It should pull in the correct item into the table based on the item name and column name. So for example, if you said Item 3 was from Vendor 2, it should populate Item #, Brand, etc. in the first table from Vendor 2's table. If you change it to Vendor 3, it should populate the first table from Vendor 3's table.

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Help searching through multiple tables to pull data into a specific table

    Hi

    See if this helps. I've had to change some of the formatting, and how the Items are listed.

    rylo

  5. #5
    Registered User
    Join Date
    05-13-2010
    Location
    Kozhikode, Keral, India
    MS-Off Ver
    Microsoft Office home and student 2019
    Posts
    49

    Red face Re: Help searching through multiple tables to pull data into a specific table

    Helo Cyali,

    Please see the attached file. I have employed the same logic that our friend Rylo has used. Minor Changes though
    1. No helper column used
    2. A new table is made in the sheet Dropdown which is used the the formulae which will ensure that the dynamic requirements are met with



    Example3.xlsx

  6. #6
    Registered User
    Join Date
    03-05-2012
    Location
    Chicago
    MS-Off Ver
    2007
    Posts
    25

    Re: Help searching through multiple tables to pull data into a specific table

    This looks like it will work beautifully; thanks, both of you! I do have one more request though - could one of you please explain to me how the offset function works so that I can apply this to my workbook with all my data? Excel Help really wasn't clear at all to me. Just a quick explanation of the required arguments would be awesome.
    Thanks again!

  7. #7
    Registered User
    Join Date
    05-13-2010
    Location
    Kozhikode, Keral, India
    MS-Off Ver
    Microsoft Office home and student 2019
    Posts
    49

    Re: Help searching through multiple tables to pull data into a specific table

    Certainly!

    Offset basically means moving away from a certain reference and returning a particular cell or range. The function has the following syntax :-OFFSET(reference,rows,cols,height,width)

    reference: - the reference from where the function has to move. Say cell c7
    rows:- is the number of rows the reference has to move away from the reference. Say 2 rows. i.e the reference will move 2 rows down. (it can be negative also to move the reference upwards).
    cols:- similar to rows above, is the number of columns the reference has to move away. Say 3 columns (move 3 columns right). It can have negative also to move reference to left.
    height:-is the number of rows the function should refer to moving away a certain number of rows and columns. Say 4 rows.
    width:- is the number of columns the function should refer to moving away a certain number of rows and columns. Say 5 columns.

    if we employ the above information in the Offset function syntax it would be
    =OFFSET(reference,rows,cols,height,width)
    =OFFSET(c7 ,2 ,3,4,5)
    i.e. move away from c7 by 2 rows, 3 columns and refer 4 rows and 5 columns. it will return a range of 4 rows and 5 columns 2 rows down and 3 columns right to the base reference that was c7.

    I hope that is clear.
    Last edited by Chandrajit; 03-10-2012 at 10:34 PM. Reason: text editing

  8. #8
    Registered User
    Join Date
    03-05-2012
    Location
    Chicago
    MS-Off Ver
    2007
    Posts
    25

    Re: Help searching through multiple tables to pull data into a specific table

    Great, thanks very much! I will probably be working on implementing this over the weekend; hopefully it all goes smoothly, but I'll post back here if I have issues with it =)

  9. #9
    Registered User
    Join Date
    03-05-2012
    Location
    Chicago
    MS-Off Ver
    2007
    Posts
    25

    Re: Help searching through multiple tables to pull data into a specific table

    I was able to apply this to my workbook with my data in it fairly easily. It didn't work exactly as you had it in the example sheet; to make it work I had to change it from
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    The IF was just to show a blank instead of a 0 if there was no info to draw from, and for each column I moved to the right I had to increment the -8 at the end (so for the very last column, units, it ended up being +2). This works perfectly for what I need, and your explanation of how OFFSET works was definitely helpful for tweaking the code a tiny bit. Thanks again for the help!

  10. #10
    Registered User
    Join Date
    05-13-2010
    Location
    Kozhikode, Keral, India
    MS-Off Ver
    Microsoft Office home and student 2019
    Posts
    49

    Re: Help searching through multiple tables to pull data into a specific table

    Hi Delighted to know tht the explanation helped!

+ 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