+ Reply to Thread
Results 1 to 4 of 4

Lookup a value within a range with 2 additional criteria, return a value

  1. #1
    Forum Contributor
    Join Date
    06-16-2014
    Location
    United States
    MS-Off Ver
    Home 2010
    Posts
    122

    Lookup a value within a range with 2 additional criteria, return a value

    I have two work sheets. The Lookup worksheet has 3 pieces of entered data: Number, Amount, and UOM. The Data worksheet contains the same data except the Amount is listed as a range (AmountMin and AmountMax), and a corresponding price. I need a formula in the Lookup worksheet (Price column) to match the Number and UOM together with the Number and UOM in the Data worksheet, and return a price based on the Amount value in the Lookup worksheet falling within the AmountMin and AmountMax values in the Data worksheet. Looked around for a solution and found some for the lookup and value within a range applications separately, but having a hard time combining the two processes. Thank you in advanced. (Example book attached).
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: Lookup a value within a range with 2 additional criteria, return a value

    You could use this array* formula in D2 of the lookup sheet:

    =IFERROR(INDEX(DATA!E:E,MATCH(1,(A2=DATA!$A$2:$A$10)*(C2=DATA!$B$2:$B$10)*(B2>=DATA!$C$2:$C$10)*(B2<=DATA!$D$2:$D$10),0)+1),"")

    *Note that an array formula needs to be committed using the key combination of Ctrl-Shift-Enter, instead of the usual < Enter >.

    Then you can copy it down as required.

    An alternative would be to use SUMIFS, like this:

    =SUMIFS(DATA!E:E,DATA!A:A,A2,DATA!B:B,C2,DATA!C:C,"<="&B2,DATA!D:D,">="&B2)

    which does not need to be array-entered (and is shorter to type, AND can accept full-column references without a time penalty)

    Hope this helps.

    Pete

  3. #3
    Forum Contributor
    Join Date
    06-16-2014
    Location
    United States
    MS-Off Ver
    Home 2010
    Posts
    122

    Re: Lookup a value within a range with 2 additional criteria, return a value

    Awesome! And if I wanted to return different data based on the same criteria (Number, Amount and UOM), would I only have to change the first parameter? Such as in the attached. I went with the SUMIFS solution above.
    Attached Files Attached Files

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: Lookup a value within a range with 2 additional criteria, return a value

    I can't see your formula in the workbook you attached, but, yes, the first parameter in SUMIFS defines the range where you want to return data from. The other parameters relate to the criteria to be applied, and are in pairs, the first of which is the range that the criteria applies to and the second is the criteria itself.

    Thanks for the rep, but could you just do another bit of "admin" and select Thread Tools from the menu above and to the right of your first post in this thread, and mark this thread as SOLVED.

    Pete

+ 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] Return cell with longest character limit based on additional criteria
    By SAsplin in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-12-2018, 09:06 AM
  2. [SOLVED] Count cells in range that match corresponding cell, and meet an additional criteria.
    By Nyima in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-15-2016, 04:11 PM
  3. [SOLVED] Sumif between a range of dates plus one additional criteria
    By caliskier in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-28-2014, 06:03 PM
  4. Lookup/ Return a value within date range base on criteria
    By kelkelkel08 in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 01-16-2014, 05:10 AM
  5. Lookup two criteria and return a third criteria as result. Aaaargh!
    By dearthofjoy in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 10-08-2013, 12:13 PM
  6. Count a single range using additional criteria from another range
    By FatFoot in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-27-2013, 08:40 PM
  7. Replies: 10
    Last Post: 02-19-2013, 12:05 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