Index Match question I think

TyeReece

Board Regular
Joined
Aug 3, 2007
Messages
136
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.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Try something like this


A
B
C
D
E
F
G
H
1
ID​
Attention Deficit​
PTSD​
Bipolar​
Schizophrenia​
ID​
Diagnosis​
2
1​
x​
x​
1​
Attention Deficit​
3
2​
1​
PTSD​
4
3​
x​
3​
Bipolar​
5
4​
x​
x​
x​
4​
PTSD​
6
5​
x​
x​
4​
Bipolar​
7
4​
Schizophrenia​
8
5​
Attention Deficit​
9
5​
Bipolar​
10

Formula in B2 copied across and down
=IF(COUNTIFS($G:$G,$A2,$H:$H,B$1),"x","")

Hope this helps

M.
 
Upvote 0

Forum statistics

Threads
1,214,806
Messages
6,121,672
Members
449,045
Latest member
Marcus05

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top