+ Reply to Thread
Results 1 to 4 of 4

Match with date to another sheet between dates

  1. #1
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Match with date to another sheet between dates

    Having trouble figuring this one out... Simple enough problem to describe and I feel like the solution will be pretty easy too:

    I have is a list of codes, each with a corresponding date. There is a second list with another code I need to match back. The part that's getting me is the second list has a Start and End date which my first date must land between.

    Sheet1: Two fields, Code and Date1
    Sheet2: Four fields, Code, StatDate, EndDate, Code2

    What I need to do is add the correct Code2 to Sheet1 where Date1 is between StartDate and EndDate


    Hope that makes sense


    Thanks
    You should hit F5, because chances are I've edited this post at least 5 times.
    Example of Array Formulas
    Quote Originally Posted by Jacc View Post
    Sorry, your description makes no sense. I just made some formula that looks interesting cause I had nothing else to do.
    Click the * below on any post that helped you.

  2. #2
    Forum Contributor
    Join Date
    10-19-2012
    Location
    Omaha, Nebraska USA
    MS-Off Ver
    Excel 2010
    Posts
    249

    Re: Match with date to another sheet between dates

    Hi Speshul,

    The attached workbook is an example of what I think you were describing. Sheet 1 has the Code and Date1 columns. When Date1 is filled in, it triggers a macro to search for the corresponding Code2 if the date entered falls between a Start and End date on Sheet 2.

    The way it is written, the Code needs to match and the date needs to be between the start and end dates for the Code2 to be copied.

    Hope this helps,

    Dan
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,597

    Re: Match with date to another sheet between dates

    Pl attach a sample file showing the required results.

  4. #4
    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
    28,253

    Re: Match with date to another sheet between dates

    Try

    =IFERROR(IF(AND(B7>=VLOOKUP(A7,Sheet2!$A$2:$D$50,2,0),B7<=VLOOKUP(A7,Sheet2!$A$2:$D$50,3,0)),VLOOKUP(A7,Sheet2!$A$2:$D$50,4,0),""),"")

    Assumes data in A:C and A:D

+ 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] increase count on tracking sheet based on date entry between dates in another sheet
    By yogup in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-04-2016, 05:14 AM
  2. [SOLVED] Match a date from a Table of dates, Help Please.
    By john dalton in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-05-2015, 08:48 AM
  3. Replies: 1
    Last Post: 08-23-2015, 08:18 PM
  4. Setting a start date and end date for Index-Match within a list of dates
    By wiqbal in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-04-2015, 10:00 PM
  5. [SOLVED] index match a value if date falls between two dates
    By Blake 7 in forum Excel General
    Replies: 4
    Last Post: 08-08-2014, 11:51 AM
  6. [SOLVED] Pay roll spread sheet - Match Dates
    By rwdriver in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-19-2012, 12:23 AM
  7. Replies: 5
    Last Post: 01-07-2012, 10:17 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