+ Reply to Thread
Results 1 to 5 of 5

Need to match 2 cells (ID & Date) in 1 spreadsheet to cells in another spreadsheet

  1. #1
    Registered User
    Join Date
    09-11-2013
    Location
    Long Island
    MS-Off Ver
    Excel 2010
    Posts
    7

    Need to match 2 cells (ID & Date) in 1 spreadsheet to cells in another spreadsheet

    I need to match the ID and Date from the Expenses tab and find a matching row in the Hotel Rates tab. The Date in the Expenses tab can fall between the Check in Date and Check out Date of the Hotel Rates tab.

    Basically I'm looking to say if Expenses B2 matches any cell in Hotel Rates column B and Expenses C2 matches any date ranges between Hotel Rates columns C and D, then it's a match. I have attached the sample file.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    01-12-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Need to match 2 cells (ID & Date) in 1 spreadsheet to cells in another spreadsheet

    Try This:
    =IF(ISNUMBER(MATCH($B2,'Hotel Rates'!$B$2:$B$4,0)),IF(AND(INDEX('Hotel Rates'!$C$2:$C$4,MATCH($B2,'Hotel Rates'!$B$2:$B$4,0))<=Expenses!$C2,INDEX('Hotel Rates'!$D$2:$D$4,MATCH($B2,'Hotel Rates'!$B$2:$B$4,0))>=Expenses!$C2),"Match","No Match"),"No Match")

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

    Re: Need to match 2 cells (ID & Date) in 1 spreadsheet to cells in another spreadsheet

    If I understand you correctly, try this, copied down...
    =IF(SUMIFS('Hotel Rates'!$E$2:$E$4,'Hotel Rates'!$A$2:$A$4,Expenses!A2,'Hotel Rates'!$C$2:$C$4,"<="&Expenses!C2,'Hotel Rates'!$D$2:$D$4,">="&Expenses!C2)>0,"Match","No Match")
    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

  4. #4
    Registered User
    Join Date
    09-11-2013
    Location
    Long Island
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Need to match 2 cells (ID & Date) in 1 spreadsheet to cells in another spreadsheet

    This formula is the one that worked for me! Thanks so much for your help!

    =IF(SUMIFS('Hotel Rates'!$E$2:$E$4,'Hotel Rates'!$A$2:$A$4,Expenses!A2,'Hotel Rates'!$C$2:$C$4,"<="&Expenses!C2,'Hotel Rates'!$D$2:$D$4,">="&Expenses!C2)>0,"Match","No Match")

  5. #5
    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,933

    Re: Need to match 2 cells (ID & Date) in 1 spreadsheet to cells in another spreadsheet

    Happy to help and 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)

Similar Threads

  1. Match data in one spreadsheet based on 2 conditions in another spreadsheet
    By dfarrel7 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-19-2012, 06:12 AM
  2. [SOLVED] Compare cells in one spreadsheet to cells in 2nd spreadsheet
    By stashu117 in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 08-10-2012, 10:16 AM
  3. Replies: 3
    Last Post: 01-24-2012, 03:10 PM
  4. copy certain cells from 1 spreadsheet to other spreadsheet depending on condition
    By Gauntsghost in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 01-14-2010, 07:06 PM
  5. Replies: 0
    Last Post: 08-15-2006, 04:00 PM

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