LOOKUP with multiple matches, and how to use criteria to return single value

MarkWilberforce

New Member
Joined
Oct 31, 2017
Messages
2
Hello. I am a first time poster here.

I am used to using lookups, but stuck with moving to a situation where I have multiple matches and want to apply a criteria to return a single value I am interested in.

The data below show some inspection data for care home quality, which include some very old reports mixed in. I want to find, for each care home, the most recent inspection result (whether they were compliant or not)

Image of data is here: https://ibb.co/gCH8vw

So, for example, I will set up a new sheet with just one entry for each care home. For care home #1 , I would like a lookup formula to return cell D6 (the most recent inspection outcome). For care home #2 , it would be D8. And so on.

I would like to know the best formula-based approach for solving this. There will be some other IF statements I add later using other variables too, so I don't want to find a workaround that sorts the data.

Any help very gratefully received.

Thank you

Mark
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
in E2
=INDEX(D$2:D$12,MATCH(MIN(IF(A$2:A$12=A2,C$2:C$12)),C$2:C$12,0))
Array formula, use Ctrl-Shift-Enter

and copy down column E
 
Upvote 0
A
B
C
D
E
F
G
H
1
IDNAMEDays since inspectionIspection outcome
2
1​
Care home name
436​
CompliantIDCompliantNon compliant
3
1​
Care home name
416​
Compliant
1​
36​
111​
4
1​
Care home name
215​
Non compliant
2​
100​
46​
5
1​
Care home name
111​
Non compliant
6
1​
Care home name
36​
Compliant
7
2​
Care home name
419​
Compliant
8
2​
Anotrhe Care home name
46​
Non compliant
9
2​
Anotrhe Care home name
413​
Compliant
10
2​
Anotrhe Care home name
232​
Non compliant
11
2​
Anotrhe Care home name
154​
Non compliant
12
2​
Anotrhe Care home name
100​
Compliant

<tbody>
</tbody>

g3=MIN(IF($A$2:$A$12=$F3,IF($D$2:$D$12=G$2,$C$2:$C$12))) control+shift+enter copy across and down
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,951
Members
449,095
Latest member
nmaske

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