Lookup Based on Criteria

Amosbroker

New Member
Joined
Mar 26, 2018
Messages
32
Hello everyone!

I'm not sure if I am just having a moment or what but cant seem to figure out how to pull in some data. I have workbook with two tabs. The first tab contains Member ID information. The second tab contains multiple diseases and episodes along with the member ID. Basically I am telling Excel - If B2 on second tab = Diabetes, then match corresponding Member ID with cell in B1 on first tab and pull in the severity level to be displayed on first tab.

First tab - Member ID and Disease, wanting severity level pulled on form second tab
Second Tab - Multiple disease listed with cooresponding severity levels

First Tab:
Member IDSeverity Level
ABC1234Want to pull in from second tab based on specific disease
ABC1246Want to pull in from second tab based on specific disease

<colgroup><col><col></colgroup><tbody>
</tbody>

Member ID

Second Tab:
Member IDLong DescriptionMajor Practice CategorySeverity Level
ABC1234DiabetesEndocrinology3
ABC1246DiabetesEndocrinology3
ABC1247DiabetesEndocrinology3
ABC1248DiabetesEndocrinology4
ABC1249DiabetesEndocrinology3
ABC1250DiabetesEndocrinology4
ABC1251Other metabolic disordersEndocrinology4
ABC1259Other metabolic disordersEndocrinology4
ABC1257Other metabolic disordersEndocrinology3
ABC1258Cerebral vascular diseaseNeurology3
ABC1259Cerebral vascular diseaseNeurology4
ABC1260Cerebral vascular diseaseNeurology4
ABC1261Cerebral vascular diseaseNeurology4
ABC1259Brain traumaNeurology4

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hi,

Array formula to be confirmed by CSE:


Book1
ABCD
1Member IDDescriptionSeverity Level
2ABC1234Diabetes33
3ABC1246Diabetes33
4ABC9999Diabetes
5ABC1259Brain trauma4
6
7Array formulaArray formula
8Description hard-codedDescription cell-referenced
Sheet149
Cell Formulas
RangeFormula
C2{=IFERROR(INDEX(Sheet153!D$2:D$15,MATCH(A2&"Diabetes",Sheet153!A$2:A$15&Sheet153!B$2:B$15,0)),"")}
D2{=IFERROR(INDEX(Sheet153!D$2:D$15,MATCH(A2&B2,Sheet153!A$2:A$15&Sheet153!B$2:B$15,0)),"")}
Press CTRL+SHIFT+ENTER to enter array formulas.



Book1
ABCD
1Member IDLong DescriptionMajor Practice CategorySeverity Level
2ABC1234DiabetesEndocrinology3
3ABC1246DiabetesEndocrinology3
4ABC1247DiabetesEndocrinology3
5ABC1248DiabetesEndocrinology4
6ABC1249DiabetesEndocrinology3
7ABC1250DiabetesEndocrinology4
8ABC1251Other metabolic disordersEndocrinology4
9ABC1259Other metabolic disordersEndocrinology4
10ABC1257Other metabolic disordersEndocrinology3
11ABC1258Cerebral vascular diseaseNeurology3
12ABC1259Cerebral vascular diseaseNeurology4
13ABC1260Cerebral vascular diseaseNeurology4
14ABC1261Cerebral vascular diseaseNeurology4
15ABC1259Brain traumaNeurology4
Sheet153


Change cell references/range and sheet name to match yours.

If your "second tab" data are never repeated, there are a couple of Non-array options.
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,732
Members
448,987
Latest member
marion_davis

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