trying to return value based on more than 1 criteria

steven179

New Member
Joined
Dec 16, 2017
Messages
1
Hi everyone!
On my Excel workbook, I am attempting to determine doctor's name based on patient ID and the Date of Service(DOS).
I have three sheets at the moment: main, Doc1 and Doc2
All three sheets contain patient ID and DOS. They may appear multiple times , especially on Doc1 and Doc 2 tabs. A patient may have been seen by different doctors, depending on DOS.
My objective is determine the doctor by matching patient IDs and DOS , based on what is on the main tab. Not sure if this is accomplished by IF statement somehow? Any help is greatly appreciated! Thanks very much.
:)
 

Some videos you may like

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Scott T

Well-known Member
Joined
Dec 14, 2016
Messages
2,615
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
ABC
1patient IDDOSDoc name
21234562/2/2017Doc3
39874563/7/2017Doc8
41234893/18/2017Doc24
59637417/7/2017Doc10
66677959/1/2017Doc23

<tbody>
</tbody>
main

Array Formulas
CellFormula
C2{=IFERROR(INDEX('doc1'!$C$2:$C$12,MATCH(A2&B2,'doc1'!$A$2:$A$12&'doc1'!$B$2:$B$13,0)),"")&IFERROR(INDEX('doc2'!$C$2:$C$12,MATCH(A2&B2,'doc2'!$A$2:$A$12&'doc2'!$B$2:$B$12,0)),"")}
C3{=IFERROR(INDEX('doc1'!$C$2:$C$12,MATCH(A3&B3,'doc1'!$A$2:$A$12&'doc1'!$B$2:$B$13,0)),"")&IFERROR(INDEX('doc2'!$C$2:$C$12,MATCH(A3&B3,'doc2'!$A$2:$A$12&'doc2'!$B$2:$B$12,0)),"")}
C4{=IFERROR(INDEX('doc1'!$C$2:$C$12,MATCH(A4&B4,'doc1'!$A$2:$A$12&'doc1'!$B$2:$B$13,0)),"")&IFERROR(INDEX('doc2'!$C$2:$C$12,MATCH(A4&B4,'doc2'!$A$2:$A$12&'doc2'!$B$2:$B$12,0)),"")}
C5{=IFERROR(INDEX('doc1'!$C$2:$C$12,MATCH(A5&B5,'doc1'!$A$2:$A$12&'doc1'!$B$2:$B$13,0)),"")&IFERROR(INDEX('doc2'!$C$2:$C$12,MATCH(A5&B5,'doc2'!$A$2:$A$12&'doc2'!$B$2:$B$12,0)),"")}
C6{=IFERROR(INDEX('doc1'!$C$2:$C$12,MATCH(A6&B6,'doc1'!$A$2:$A$12&'doc1'!$B$2:$B$13,0)),"")&IFERROR(INDEX('doc2'!$C$2:$C$12,MATCH(A6&B6,'doc2'!$A$2:$A$12&'doc2'!$B$2:$B$12,0)),"")}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>

ABC
1patient IDDOSDoc name
21234561/1/2016Doc1
38527411/9/2017Doc2
41234562/2/2017Doc3
57894652/5/2017Doc4
64942/6/2017Doc5
74962/6/2017Doc6
89842/20/2017Doc7
99874563/7/2017Doc8
109494/7/2017Doc9
119637417/7/2017Doc10
1249848/5/2017Doc11

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><tbody>
</tbody>
doc1



ABC
1patient IDDOSDoc name
2456856/4/2017Doc20
3456448/20/2017Doc21
4719688/25/2017Doc22
56677959/1/2017Doc23
61234893/18/2017Doc24
742424/1/2017Doc25
842424/19/2017Doc26
92425/27/2017Doc27
10512526/17/2017Doc28
114126/22/2017Doc29
124111/11/2017Doc30

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><tbody>
</tbody>
doc2
 

Watch MrExcel Video

Forum statistics

Threads
1,122,564
Messages
5,596,875
Members
414,106
Latest member
Tigretto

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