Hi
I have a table (sheet1) that contains. Date column(A), ID column (B) and Time column (D) In a new sheet i need to populate (sheet2) cell C2 and D2 based on the following Conditions. (sheet2) column (A) contains date for each record, column (B) contains ID. note: sheet1 has been sorted by Date, time and ID

C2 = sheet1A:A,>=sheet2!A2 and sheetA:A,<=sheet!A2 and Sheet1B:B,=Sheet2!B2 then return First value from sheet1,C:C.
D2 = sheet1A:A,>=sheet2!A2 and sheetA:A,<=sheet!A2 and Sheet1B:B,=Sheet2!B2 then return Last value from sheet1,C:C.

Thanks