Index match min if

johnsnider

New Member
Joined
Aug 23, 2018
Messages
9
ABC
1IDSubjectscore
21000Math80
31001English45
41002Math60
51002English87
61001English50
71000Chem54
81001Math71
91002Chem83
10
11
12
13IDNameAge
141000matt12
151001john15
161002simon16

<tbody>
</tbody>



This solution needs to be a formula that must be within one cell and needs to be dynamic(e.g changes).

Q
What subject did john score the highest?

So far I've attempted this but I don't understand why it's not working
=INDEX(B2:C9,MATCH(MAX(IF(A2:A9=INDEX(A14:A16,MATCH("john",B14:B16,0)),C2:C9)),C2:C9,0),1)
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Try this array formula

=INDEX(B2:C9,MATCH(MAX(IF(A2:A9=INDEX(A14:A16,MATCH("john",B14:B16,0)),C2:C9)),IF(A2:A9=INDEX(A14:A16,MATCH("john",B14:B16,0)),C2:C9),0),1)
confirmed with Ctrl+Shift+Enter, not just Enter

M.
 
Upvote 0
Very nice it worked, thank you for the help. Could I possibly get your logic behind the second if statement or why you used 2 IFs.
 
Last edited:
Upvote 0
The second argument of MATCH, lookup_array, should contain only the values corresponding to John, otherwise the formula may return an incorrect value.

For example, change the value of the cell C5 from 87 to 71 (identical to John's maximum). A formula that uses simply C2:C9 as the second argument of MATCH (lookup_array) would return English which obviously is wrong.

M.
 
Upvote 0

Forum statistics

Threads
1,214,837
Messages
6,121,883
Members
449,057
Latest member
Moo4247

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