+ Reply to Thread
Results 1 to 6 of 6

Lookup ID and between dates?

  1. #1
    Forum Contributor
    Join Date
    11-22-2006
    MS-Off Ver
    2010
    Posts
    201

    Lookup ID and between dates?

    Hello everyone, hope someone can help me with this.

    In a sheet called "data" I have a list of ID numbers, in column B (the length of this column could change, but is currently row 1 to row 12000, where row 1 has the column header).
    In column K is a date.

    The same ID number could appear multiple times in column B, but on each occassion there would be a different date in column k.

    Here comes the difficult bit.
    In another sheet, called "import" is a list of ID numbers in column B.
    On the same sheet, in columns C and D are "to" and "from" dates.

    What I want to be able to do is to look lookup the information from "data" and report back where the ID number appears in "import" and crucially where the data in column B of "data" is on or between the dates in column C and D of "import".

    ANy help on how to do this would be really fantastic.
    Thanks everyone.

  2. #2
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    Most probably you need a sumproduct() formula ...
    Why don't you upload a zipped sample of your workbook for a precise answer ...
    HTH
    Carim


    Top Excel Links

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,697
    I’m assuming you want a formula in E2 that will just give TRUE or FALSE, the ID in B2 appears in data worksheet with a date (or dates) between C2 and D2…..or not. Try this formula

    =SUMPRODUCT(--(B2=data!B$2:B$12000),--(C2<=data!K$2:K$12000),--(D2>=data!K$2:K$120000))>0

    copied down

  4. #4
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    You should be very careful with formatting of your dates in sheet import ...
    as far as the formula is concerned, daddylonglegs formula is spot on ...
    have trimmed down your file a meaningful sample ...
    Attached is a working example ...
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    11-22-2006
    MS-Off Ver
    2010
    Posts
    201
    Dear Carim and Daddylonglegs, many thanks for your replies, and especially to Carim for taking the time to respond to the zipped example, that works so well.
    Thanks again.

  6. #6
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Glad your problem is fixed ...

    Thanks for the feedback

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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