What you are searching I could not found, All I can see that you extracted data on sheet2 from the date mentioned in A1 to the date mentioned in B1, for all the ID. Is this you want? you will enter the start date and end date and you should get all the data for all the id's?
Well I cannot help you on Google Sheet, but see the attached file made on excel 2010. Please note the first three columns on sheet2 are entered manually. DO you want them to extract to?