Return text if column and row match values
Hi, I'm trying to get text from a cell in a specific column and (this is the hard part for me) in row that is determined first by matching a value in a column and then moving down to find a different value in a different column. Here's an example:
ID# ADMISSION DIAGNOSIS
1234 9/23/09 CHF
1234 10/15/09 COPD
1234 1/23/10 CKD
1356 07/01/09 DM
1999 01,5/11 HTN
1999 12/01/09 AFIB
I want the diagnosis for patient with ID 1234 and an admission date of 1/23/10. A patient can have any number of admissions, could be 1 or 7 or more. So I need to find the specific patient first (ID#), go to the admission date I want (ADMISSION), and then return the text in that row and the diagnosis column. In this case, CKD.
Thanks!
|