+ Reply to Thread
Results 1 to 4 of 4

Lookup with exact match and date range

  1. #1
    Registered User
    Join Date
    01-18-2021
    Location
    Costa Rica
    MS-Off Ver
    2010
    Posts
    2

    Lookup with exact match and date range

    Hi Experts!

    I'm trying to do a lookup with multiple criteria, but instead of trying to find 2 exact values, one is a specific code (exact match) and the other is a date to be matched within a date range in 2 different columns.

    I'm including an excel file with an example of the 2 sets of data: A) with the code, specific date, and B) with the code, date range and price to be returned into the first chart.

    Hope the file helps to understand my question better. I have been trying to do it with INDEX and MATCH formulas but I have not even come close to a solution yet.

    Set A
    Item Code Date Desired result (currently empty )
    12345678 2/15/2009 $10
    12345678 7/2/2009 $9
    87654321 11/12/2009 $12
    87654321 1/1/2010 Not found (N/A)
    87654321 5/1/2009 $19
    87654321 8/3/2009 $21
    87654321 10/1/2009 $23
    87654321 9/30/2009 $21
    12348765 2/1/2009 $5
    12348765 11/12/2009 $3
    12348765 10/1/2009 $3
    12348765 10/1/2009 $3

    Set B

    Item Code Valid From Valid To Price
    12345678 1/1/2009 3/1/2009 $10
    12345678 4/1/2009 6/30/2009 $11
    12345678 7/1/2009 9/30/2009 $9
    12345678 10/1/2009 12/31/2009 $12
    87654321 1/1/2009 3/1/2009 $20
    87654321 4/1/2009 6/30/2009 $19
    87654321 7/1/2009 9/30/2009 $21
    87654321 10/1/2009 12/31/2009 $23
    12348765 1/1/2009 3/1/2009 $5
    12348765 4/1/2009 6/30/2009 $4
    12348765 7/1/2009 9/30/2009 $6
    12348765 10/1/2009 12/31/2009 $3

    Thanks in advance!!
    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,724

    Re: Lookup with exact match and date range

    You can use this array* formula in cell C2 of Sheet1:

    =IFERROR(INDEX(Sheet2!$D$2:$D$13,MATCH(1,(Sheet2!$A$2:$A$13=A2)*(Sheet2!$B$2:$B$13<=B2)*(Sheet2!$C$2:$C$13>=B2),0)),"Not found")

    *Note that an array formula needs to be committed using the key combination of Ctrl-Shift-Enter (CSE), rather than the usual Enter.

    then copy down as required.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    01-18-2021
    Location
    Costa Rica
    MS-Off Ver
    2010
    Posts
    2

    Re: Lookup with exact match and date range

    That worked perfectly!! Thank you very much!!

  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,724

    Re: Lookup with exact match and date range

    You're welcome - thanks for the rep.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the 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] Table lookup for exact match and match between range
    By chris4mayor in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-16-2018, 05:54 PM
  2. Exact Date and Time compare within a range of exact date and times Lookup and Flag
    By john2001 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2015, 06:01 PM
  3. Replies: 3
    Last Post: 06-17-2013, 12:37 PM
  4. [SOLVED] How to match the exact value from the date range?
    By PRADEEPB270 in forum Excel General
    Replies: 2
    Last Post: 12-13-2011, 11:52 AM
  5. Replies: 5
    Last Post: 02-24-2011, 11:26 AM
  6. [SOLVED] Match - Exact - Lookup?
    By Danny in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-27-2006, 05:10 PM
  7. Lookup - Exact Match
    By Anth in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-18-2005, 06:08 AM

Tags for this Thread

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