+ Reply to Thread
Results 1 to 4 of 4

VLOOKUP based on 2 value criteria

  1. #1
    Registered User
    Join Date
    04-14-2014
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2019 (PC) Version 1808
    Posts
    46

    VLOOKUP based on 2 value criteria

    I want to write a formula in cell E1 to pull in Part Number from column A if the width is greater than or equal to the value in column C and the length is greater than or equal to the value in column B. Multiple parts may fulfill these criteria, but I want it to pull in the part that most closely satisfies width first and then most closely satisfies the length.

    Example: If the part sample is this:

    PART LENGTH WIDTH
    2101870 16.31 2
    2101871 19.31 2
    2103536 19.31 2
    2101947 20.5 2
    2101873 25.31 2
    2101875 31.31 2
    2103537 31.31 2
    2101876 34.31 2
    2103500 45 2
    2101948 20.75 2.5
    2103501 20.75 2.5
    2103502 44 2.5

    And I want the formula to choose the best part that fits 20.75 length and 2 width, I would expect it to choose 2101947. Is this possible?? Thanks!!
    Attached Files Attached Files
    Last edited by brendangroff; 12-12-2019 at 02:55 PM.

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: VLOOKUP based on 2 value criteria

    If your width and length column are always sorted in ascending order (as you have in your sample) use

    =LOOKUP(2,1/INDEX(($C$2:$C$13<=C19)*($B$2:$B$13<=C18),0),$A$2:$A$13)
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Registered User
    Join Date
    04-14-2014
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2019 (PC) Version 1808
    Posts
    46

    Re: VLOOKUP based on 2 value criteria

    Quote Originally Posted by Ace_XL View Post
    If your width and length column are always sorted in ascending order (as you have in your sample) use

    =LOOKUP(2,1/INDEX(($C$2:$C$13<=C19)*($B$2:$B$13<=C18),0),$A$2:$A$13)
    I think it is close, but not quite there. The width has to be greater than the example of 2--If I change the example to 2.1 it still pulls in the 2 width part.

  4. #4
    Registered User
    Join Date
    04-14-2014
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2019 (PC) Version 1808
    Posts
    46

    Re: VLOOKUP based on 2 value criteria

    Quote Originally Posted by Ace_XL View Post
    If your width and length column are always sorted in ascending order (as you have in your sample) use

    =LOOKUP(2,1/INDEX(($C$2:$C$13<=C19)*($B$2:$B$13<=C18),0),$A$2:$A$13)
    You know what I think I got it--just have to sort the data descending instead of ascending. Thanks!

+ 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] Vlookup & Sum based on a Criteria
    By babyjohnson in forum Excel General
    Replies: 9
    Last Post: 08-08-2016, 05:07 AM
  2. Vlookup based on a criteria
    By mifzal.mufthi in forum Excel General
    Replies: 18
    Last Post: 08-01-2016, 03:34 AM
  3. [SOLVED] VLookup Based on Criteria
    By Corzbb10 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-28-2015, 04:39 PM
  4. [SOLVED] Vlookup based on 2 Different Criteria
    By Darrellcoholic in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-09-2014, 05:10 AM
  5. [SOLVED] Vlookup based on more than one criteria
    By djm601 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-22-2013, 08:17 AM
  6. [SOLVED] Vlookup based on 2 or more criteria
    By mike ryan in forum Excel General
    Replies: 3
    Last Post: 04-04-2012, 09:59 AM
  7. VLOOKUP based on two criteria
    By kumawat_s in forum Excel General
    Replies: 6
    Last Post: 07-28-2011, 03:47 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