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.
 

Some videos you may like

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
16,501
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
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.
 

TyeReece

Board Regular
Joined
Aug 3, 2007
Messages
136
That is it! Looks like I was trying to make it harder than it had to be. Thanks!
 

Watch MrExcel Video

Forum statistics

Threads
1,127,752
Messages
5,626,661
Members
416,199
Latest member
Gautamsunil

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
Top