+ Reply to Thread
Results 1 to 8 of 8

Vlookup with multiple criteria?

Hybrid View

  1. #1
    Registered User
    Join Date
    01-28-2015
    Location
    Tampa, FL
    MS-Off Ver
    2010
    Posts
    110

    Vlookup with multiple criteria?

    Hi everyone,

    I am trying to perform a vlookup based on multiple criteria.

    In the attached spreadsheet, my data is represented in columns A:E. In columns H-N, I am trying to lookup up the "Rate" for all 4 items based on the "BT", "Code" and "Key" matching. However, I also want one of the criteria's to be if the BT Term Date = the Rate_Limit_Date OR, if they don't equal, I want to return the "Rate" value that was active at the time of the BT Term Date. Does that make sense?

    For example, for the first item, there are multiple line items with a code of 3J03, so I would want to return the "Rate" of the line item where the BT matches "TI", Code matches "3J03", Key matches "FR" and where the Rate_Limit_Date is less than and as close to 12/31/2013 as possible.

    Any suggestions?
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Vlookup with multiple criteria?

    Will there always only be 1 match for what you want?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Vlookup with multiple criteria?

    This is what I have so far, but it does not take into account non-exact date matches...
    =INDEX($C$2:$C$204,MATCH(H2&J2&L2&I2,INDEX($A$2:$A$204&$B$2:$B$204&$D$2:$D$204&$E$2:$E$204,0),0))

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Vlookup with multiple criteria?

    OK, I just noticed that your dates in E are not real dates, they are text - you need to fix that 1st.
    1. highlight that range
    2. on the Data tab, click Text2Columns
    3. click Next/Next/ check Date and select your data format
    4. Click OK

    On the assumption that there will only ever be 1 match, see if this will do what you want...
    =SUMIFS($C$2:$C$204, $A$2:$A$204,H2, $B$2:$B$204,J2, $D$2:$D$204,L2,$E$2:$E$204,"<="&I2)

  5. #5
    Registered User
    Join Date
    01-28-2015
    Location
    Tampa, FL
    MS-Off Ver
    2010
    Posts
    110

    Re: Vlookup with multiple criteria?

    Thanks so much FD! Yes, there will always be only 1 match because if it came down to only the dates, I would want the one closest to the BT Term Date! I will try and use that formula tomorrow when I am back in the office and let you know how it works. I appreciate your time and expertise!

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Vlookup with multiple criteria?

    If there will only be 1 match, then my 2nd formula (SUMIFS) should give you what you want.

    let me know how you make out?

  7. #7
    Registered User
    Join Date
    01-28-2015
    Location
    Tampa, FL
    MS-Off Ver
    2010
    Posts
    110

    Re: Vlookup with multiple criteria?

    Hi FD. The formula is summing the values. I actually need it to tell me the particular rate on the date the BT terminated. For example, for the first line item, what was the particular rate for BT "TI", Code "3j03" and Key "FR" on 12/31/2013.

    I would expect the formula to return $37.29 because that was the rate that falls between the 8/31/13 Rate Limit Date and the 12/31/2014 Rate Limit Date (Column E). So that was the rate that was active at the time of 12/31/2013.

    For the second line item, because there happens to be a Rate Limit Date = the BT Term Date of 12/31/2099, I would expect the formula to return $40.83.
    Last edited by tkbuc; 06-16-2016 at 08:59 AM.

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,862

    Re: Vlookup with multiple criteria?

    Add helper column in F

    =A2&B2&D2&E2
    and copy down

    Custom Sort by column F (A to Z)

    To get rate

    =INDEX($C$2:$C$1000,MATCH(H2&J2&L2&I2,$F$2:$F$1000,1))

    NOTE: dates must be dates not text.

+ 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 multiple criteria returning multiple values
    By ykobure in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 04-16-2015, 07:28 AM
  2. [SOLVED] iserror and vlookup with multiple criteria from multiple tables along with concatenation.
    By marcusduton in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-14-2015, 02:16 AM
  3. Vlookup on multiple axis with multiple criteria
    By theLOLkid in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-11-2015, 02:48 PM
  4. Vlookup (or index/match) with multiple criteria over multiple sheets
    By Groovicles in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-18-2013, 01:56 PM
  5. vlookup? match? index? MULTIPLE criteria for vlookup search problem....
    By aborg88 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-11-2013, 09:56 AM
  6. Possible VLOOKUP multiple criteria & multiple worksheets
    By this2willpass in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-16-2012, 08:23 AM
  7. Vlookup + multiple criteria + multiple data returned
    By stonesy in forum Excel General
    Replies: 6
    Last Post: 02-17-2010, 08:53 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