For a research project I am trying to find out how often several hundred patients have been admitted to various hospital departments, and additional info like the type of discharges etc. For each department I have a spreadsheet covering all sorts of data from the late 90s to today (resulting in tens of thousands of rows in each spreadsheet, for a total of seven spreadsheets). However, for each patient I am only interested in a 2-year period after they have completed a certain treatment. The problem is that this period is different for each patient.
I have cleaned up most of the mess, so the first column contains the unique patient ID (in each row, usually covering dozens to several hundred rows), the second column contains the individual admission dates. An additional spreadsheet contains the patient IDs in the first column, the index date in the second, and the end date of the follow-up period in the third column.
Now I need to remove (or filter out) all rows in the spreadsheets that contain admission dates that fall outside the 2-year period. I know how to filter by date range with advanced filters across the whole spreadsheet, but after quite some time on Google and looking at tutorials I am still at a loss as to how to do this for different individual index dates for each patient. I have found out that a pivot table is supposed to help, but I don't know how to link such a table to my spreadsheet (or sheet) containing the data on individual follow-up periods, so excel checks the index date for each patient ID to filter out the rows containing dates that fall outside this period.
If anyone could point me towards the right option in Excel, or any resource/tutorial to achieve this, that would be greatly appreciated
Bookmarks