I have two worksheets. Table 1 is of unique records. Table 2 is a table of conditions that may or may not match up with a unique record. Look like this:
Table 1
ID Attention Deficit PTSD Bipolar Schizophrenia
1
2
3
4
5
Table 2
ID Diagnosis
1 Attention Deficit
1 PTSD
3 Bipolar
4 PTSD
4 Bipolar
4 Schizophrenia
5 Attention Deficit
5 Bipolar
What I want to do is put a "true" or the Diagnosis name from Table 2 in column 2 of Table 1, if there is a record that matches the ID in Column A Row 2 of Table 1 and matches the diagnosis in Cell B2 of Table 1. The formula I am using (=IF($A2<>"",VLOOKUP($A2,'All Dx During Tx'!$A$2:$B$2021,MATCH(DJ$1,Columns,0),FALSE),"")) returns IF there is a matching ID but does not specify the diagnosis. Thanks in advance.
Table 1
ID Attention Deficit PTSD Bipolar Schizophrenia
1
2
3
4
5
Table 2
ID Diagnosis
1 Attention Deficit
1 PTSD
3 Bipolar
4 PTSD
4 Bipolar
4 Schizophrenia
5 Attention Deficit
5 Bipolar
What I want to do is put a "true" or the Diagnosis name from Table 2 in column 2 of Table 1, if there is a record that matches the ID in Column A Row 2 of Table 1 and matches the diagnosis in Cell B2 of Table 1. The formula I am using (=IF($A2<>"",VLOOKUP($A2,'All Dx During Tx'!$A$2:$B$2021,MATCH(DJ$1,Columns,0),FALSE),"")) returns IF there is a matching ID but does not specify the diagnosis. Thanks in advance.