+ Reply to Thread
Results 1 to 6 of 6

vlookup two value between dates

  1. #1
    Forum Contributor
    Join Date
    03-24-2009
    Location
    Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    382

    vlookup two value between dates

    Hi,

    Need some help with a formula here please...

    I have a list of food consumption postings, remarking the posting date and room number of the guest who consumed the food. Now I have another report with the arrival, departure and number of adults per room. I would like to link those two reports together by both matching the ROOM NUMBER as well check if the POSTING DATE is between the the arrival and departure date of the room. If yes, I would need the formula to return the total number of adults in the room.

    So in short:
    * Match both reports by room number AND see if posting date is between arrival / departure
    * return the number of adults from Data 1 sheet to Data 2 sheet

    I have attached a sample and would love to get some guidance on this
    Thanks,

    A2k

    Lookup Sample.xlsx

  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
    52,939

    Re: vlookup two value between dates

    See if this will work for you?

    =IF(AND(VLOOKUP(D2,$B$19:$G$31,3,0)<=B2,VLOOKUP(D2,$B$19:$G$31,4,0)>=B2),VLOOKUP(D2,$B$19:$G$31,6,0),"")
    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
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: vlookup two value between dates

    Or this Array Formula which requires confirmation with Ctrl+Shift+Enter instead of just Enter.

    In F2
    Please Login or Register  to view this content.
    and copy down.
    Attached Files Attached Files
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: vlookup two value between dates

    In Data 1 Sheet Row No. 6 & Row No. 12 have same Room Number 308 with different arrival and Departure Data, in this situation what to do
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  5. #5
    Forum Contributor
    Join Date
    03-24-2009
    Location
    Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    382

    Re: vlookup two value between dates

    Thanks guys, sktneer's array fixed it for me.

    Sorry about the incorrect sample data, logically that was an error from my side since one room can only be occupied by one reservation at a time. Anyway, its working

    Thanks a lot!
    A2k

  6. #6
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: vlookup two value between dates

    You're welcome. Thanks for the feedback.
    If that takes care of your question, please mark your thread as Solved. (I hope you know how to do that.)

+ 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 dates between two dates and count the number of days
    By nishikanth in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-28-2013, 03:25 AM
  2. VLOOKUP and Dates
    By Telegraph Sam in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-28-2013, 06:49 PM
  3. VLOOKUP with dates
    By Amanda1416 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-13-2013, 07:03 PM
  4. VLookUp - using dates?
    By akhlaq768 in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 07-27-2009, 09:23 AM
  5. [SOLVED] VLookUp with Dates
    By o1darcie1o in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 07:05 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