+ Reply to Thread
Results 1 to 25 of 25

Vlookup two tables to choose from 3rd table

  1. #1
    Forum Contributor
    Join Date
    03-10-2009
    Location
    chicago illinois
    MS-Off Ver
    Excel 2010
    Posts
    127

    Vlookup two tables to choose from 3rd table

    I have a spreadsheet where I have two tables A5:C15 and A16 to C26. These tables calculate all the possible options for an item across a sheet and all the possible options down the sheet. I some how need to automatically calculate the "best" option to fit on a few different sheet sizes E5:F13. So in the attached the best option is 5 down and 3 across and that size would be 27.5625 x 31.5. These numbers will change based on sizes that are input on another screen but for example I am posting one example/ For this example in real life and manually I would want it to be associated with the 28 x 35 in E5:F13. Is there a formula to automatically select the max sizes from C6:C15 (in this case 27.5625) and max size from C17:C26 (in this case 31.5) and have it select the best option from E5:F13. The table from E5:F13 the width and length dimensions are tied together so the options are 18 x 22, 20 x 26, 27 x 32, 28 x 35 and 28 x 40. So it cant look at the table and then select 28 from the width and then 32 from the length. Hopefully this makes sense and can be done. Im sure it can but I have been working in the spreadsheet for a couple hours and my mind is drawing a blank.

    I apologize if the title is correctly worded too
    Attached Files Attached Files
    Last edited by sp1974; 05-30-2017 at 09:05 AM.

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Vlookup two tables to choose from 3rd table

    These numbers will change based on sizes that are input on another screen
    If the hypothetical numbers from another screen were in I2:J2 as in the attached, then array enter these two formulas in I3 and J3.If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  3. #3
    Forum Contributor
    Join Date
    03-10-2009
    Location
    chicago illinois
    MS-Off Ver
    Excel 2010
    Posts
    127

    Re: Vlookup two tables to choose from 3rd table

    This is similar to what I need, however, in the table E7:F13 each dimension in E must tie to the same dimension in F in the same row. So 18 has to go with 22, 27 goes with 32, etc. Unfortunately it isnt the best dimension from each column.

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,542

    Re: Vlookup two tables to choose from 3rd table

    Since the area of the Sheet sizes on the table increases it would seem that formulas could be set up to find the smallest area that is greater than or equal to the smallest sheet sizes that can be calculated.
    The following proposed solution uses a number of helpers, which may be moved and/or hidden for aesthetic purposes.
    The helper that gets the smallest table size for 'Sheet Size Down' is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    The helper that gets the smallest table size for 'Sheet Size Across' is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    The formula that returns the actual sheet width is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    The formula that returns the actual sheet length is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Forum Contributor
    Join Date
    03-10-2009
    Location
    chicago illinois
    MS-Off Ver
    Excel 2010
    Posts
    127

    Re: Vlookup two tables to choose from 3rd table

    This is exactly what I need to find the sheet size but it will constantly be changing based on piece size in A3 and B3. When those dimensions change the tables in A6:C15 and A17:C26 then change as well which would effectively change the maximum number down and across. How can I tie that into what you provided?

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,542

    Re: Vlookup two tables to choose from 3rd table

    I believe that the part of the first two formulas that reads ...MATCH(MAX(C$6:C$15)... and ...MATCH(MAX(C$17:C$26)... takes care of that.
    However the formula in I3 does need to be modified so that it reads:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Once the formula has been entered, copy it across to J3.
    If the solution isn't yielding the correct results when the dimensions change, please provide an example of the values in A3 and B3 that cause the failure as well as the expected results for I3 and J3.
    Let us know if you have any questions.

  7. #7
    Forum Contributor
    Join Date
    03-10-2009
    Location
    chicago illinois
    MS-Off Ver
    Excel 2010
    Posts
    127

    Re: Vlookup two tables to choose from 3rd table

    You are correct. I was coming to apologize after working with it a bit longer. Thanks.

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,542

    Re: Vlookup two tables to choose from 3rd table

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

  9. #9
    Forum Contributor
    Join Date
    03-10-2009
    Location
    chicago illinois
    MS-Off Ver
    Excel 2010
    Posts
    127

    Re: Vlookup two tables to choose from 3rd table

    Ok after working on this a bit to make it fit to my real life situation (multiple materials and multiple sizes within those materials) I am coming up with some #REF and #N/A that hopefully you can help with. I realize it may be an issue for grouping m13:r16 since the numbers in P aren't in order if I understand what I read on index and match formulas. I tried to adjust the formula and removed row 16 all together and it is the same result as whats attached. Each material group is separated with bold grid line. The separation is by weights. The size that will be changing is in cell C3 and D3. In the actual spreadsheet it is a formula referencing another cell in another tab but due to sensitive info in that tab I had to clean it up and just provide the tab I am working in. Based on the original size of 5 x 10 I only have a few cells with the errors but if I change to 5.125 x 6.25 I get all but 2 cells with the errors. Any suggestions? Thanks
    Attached Files Attached Files
    Last edited by sp1974; 05-16-2017 at 10:11 AM.

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,542

    Re: Vlookup two tables to choose from 3rd table

    Some modifications have been made to the formulas, so that I believe that the expected results for 5 1/8 x 6 1/4 are being returned in the 'By Table' range.
    Let us know if you have any questions.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    03-10-2009
    Location
    chicago illinois
    MS-Off Ver
    Excel 2010
    Posts
    127

    Re: Vlookup two tables to choose from 3rd table

    Thank you so much!!!!

  12. #12
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,542

    Re: Vlookup two tables to choose from 3rd table

    You're Welcome. If you see any other issues reply back to this thread (I'll get notified), or start a new one (the more eyes on a problem the better) and include a link to this one.

  13. #13
    Forum Contributor
    Join Date
    03-10-2009
    Location
    chicago illinois
    MS-Off Ver
    Excel 2010
    Posts
    127

    Re: Vlookup two tables to choose from 3rd table

    I have been doing some testing now that I am further along in my spreadsheet and found that the formulas previously provided aren't working as I needed. Based on the info from the tables, Drop Downs & Layout tab the table in E16:K36 have determined that a sheet size of 25.125 x 33.375 is needed. Then in the materials tab where the formulas I need help with it didn't pull the info that I needed. Specifically in cell S15. It populated 33 but I need a value larger then 33.375. The value I would like it to populate is in row 23. Id like it to populate 28 x 36 in cells R15 (28) and S15 (36). It also looks like the yellow cells in R and S below R15 and S15 are also populating sizes that are smaller the the minimum of 25.125 and 33.375. Any help with this? If I reorder the table A6:L89 in the materials tab based on descending order based on column F would that be better for the match formulas and then being able to change the match type in the formula to -1? If so how would I need to adjust the formulas in N:S?
    Attached Files Attached Files

  14. #14
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,542

    Re: Vlookup two tables to choose from 3rd table

    See if the following array entered formula*, pasted into cell S15, helps with that particular issue:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    *As Dave stated, array entered formulas must be activated by simultaneously pressing the Ctrl, Shift and Enter keys while the cell is in edit mode.
    Let us know if you have any questions.

  15. #15
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,542

    Re: Vlookup two tables to choose from 3rd table

    I tested this array entered formula in R29 and it returned the result I expected (28):
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Let us know if you have any questions.

  16. #16
    Forum Contributor
    Join Date
    03-10-2009
    Location
    chicago illinois
    MS-Off Ver
    Excel 2010
    Posts
    127

    Re: Vlookup two tables to choose from 3rd table

    Is there anyway to do this without array formulas? The users of this file may have basic skills and it is being designed for them to just enter basic required info into a tab (not shared) and the other tabs in the workbook do all the calculations. So to have some activate the array may be challenging even though Ctrl, shift and enter sounds simple enough I know some of the users will not activate it. Im trying to make this as "dummy proof" as possible.

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Vlookup two tables to choose from 3rd table

    Why would somebody just entering data need to enter an array formula? You seem to be saying that you will set up all the calculated fields in advance, so just protect the sheet.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  18. #18
    Forum Contributor
    Join Date
    03-10-2009
    Location
    chicago illinois
    MS-Off Ver
    Excel 2010
    Posts
    127

    Re: Vlookup two tables to choose from 3rd table

    I'm building a price model so users will enter info required to calculate price (material, size, colors, etc). The tabs that calculate and contain formulas will be locked down.

    Maybe I don't understand array formulas enough. For an array formulas does control, shift and enter need to hit everytime or does it only need to be done when I go back and revise the formula (hopefully never once it's set up)?

    Thanks

  19. #19
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Vlookup two tables to choose from 3rd table

    The latter - it's just the way you enter that type of formula. Once entered, they behave just the same as any other formula.

  20. #20
    Forum Contributor
    Join Date
    03-10-2009
    Location
    chicago illinois
    MS-Off Ver
    Excel 2010
    Posts
    127

    Re: Vlookup two tables to choose from 3rd table

    Ok so next question would be JeteMc references S15 and R29 for the formulas he provided. Would I copy and paste the formulas into R7, R12, R25, R29, R39, R43, R51, R54, R63, R71, R74, R78, R80, R83, R86 and R88 and S7, S12, S25, S29, S39, S43, S51, S54, S63, S71, S74, S78, S80, S83, S86 and S88 and adjust the ranges within the formulas for each? If so I did that for R7 & S7 and it resulted in a result of #Value. What does the -28 in the formula for the cell in column R and the -14 in formula for the cell in column S represent?

  21. #21
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,542

    Re: Vlookup two tables to choose from 3rd table

    Yes, the formula for S15 should be copied, pasted and modified for the other cells in column S. Likewise for the formula for the formula for R29. The -28 and -14 are there to make sure that the 'ROW' array starts at 1 (select S15 and run the Evaluate Formula feature found on the Formulas tab). You could also S15 formula to read (likewise for the R29 formula):
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Let us know if you have any questions.

  22. #22
    Forum Contributor
    Join Date
    03-10-2009
    Location
    chicago illinois
    MS-Off Ver
    Excel 2010
    Posts
    127

    Re: Vlookup two tables to choose from 3rd table

    When I copy the last formula you posted into R7 & S7 and adjust the ranges for 7 to 11 where appropriate in the formula and then Ctrl, Shift and Enter it results in a #N/A. See the attached. Did I not do something right?
    Attached Files Attached Files

  23. #23
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,542

    Re: Vlookup two tables to choose from 3rd table

    Here is the array entered formula that should go into R7:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Once that formula is activated by simultaneously pressing the Ctrl, Shift and Enter keys, S7 displays the correct value (34).
    Let us know if you have any questions.

  24. #24
    Forum Contributor
    Join Date
    03-10-2009
    Location
    chicago illinois
    MS-Off Ver
    Excel 2010
    Posts
    127

    Re: Vlookup two tables to choose from 3rd table

    Thanks. I will adjust the other cells needing these formulas and then do some testing. Hopefully you won't hear back from me. I appreciate all the help.

  25. #25
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,542

    Re: Vlookup two tables to choose from 3rd table

    You're Welcome and thank you for the feedback. If the modified formula solves the issue, please take a moment to mark the thread as 'Solved'. I hope that you have a blessed day.

+ 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] Display Table via Dropdown. Vlookup across multiple tables.
    By DAE05 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-04-2017, 11:10 AM
  2. [SOLVED] Choose from tables
    By Andrew.Trevayne in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-09-2017, 10:35 AM
  3. [SOLVED] Vlookup & Choose
    By timbo1957 in forum Excel General
    Replies: 8
    Last Post: 03-22-2012, 10:21 AM
  4. Choose between numbers in different tables
    By johrm50 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-15-2011, 05:49 PM
  5. Excel 2007 : When should I choose IF, AND, VLOOKUP?
    By Garethrowe in forum Excel General
    Replies: 1
    Last Post: 02-01-2011, 08:11 AM
  6. [SOLVED] Vlookup or choose or?
    By Dean in forum Excel General
    Replies: 1
    Last Post: 01-12-2006, 02:25 PM
  7. Replies: 8
    Last Post: 01-02-2006, 07:40 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