Struggling so much with INDEX MATCH

Steviefiege

Board Regular
Joined
Aug 29, 2018
Messages
66
Hi,
One day i'll get my head around how to you these 2 functions properly.

I want to find my best Goalkeeper out of a list of players. In my sheet so far i have the position & the highest rating for that position, i just need to match the position with the rating to get the player. Sounds so easy, i can just never get my head around it.


<tbody>
[TD="class: xl65, colspan: 2"]Goalkeeper[/TD]
[TD="class: xl66, width: 64"][/TD]
[TD="class: xl67, width: 64"]55.77[/TD]

</tbody>
[TABLE="width: 256"]
<tbody>[TR]
[TD="colspan: 2"][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]



<tbody>
[TD="class: xl67"]Kongolo, Rodney[/TD]
[TD="class: xl69, width: 130"]Advanced Playmaker[/TD]
[TD="class: xl71, width: 89"]45.00[/TD]

[TD="class: xl67, width: 200"]Kongolo, Rodney[/TD]
[TD="class: xl69"]Attacking Midfielder[/TD]
[TD="class: xl71"]47.92[/TD]

[TD="class: xl67, width: 200"]Kongolo, Rodney[/TD]
[TD="class: xl69"]Advanced Playmaker2[/TD]
[TD="class: xl71"]45.00[/TD]

[TD="class: xl68, width: 200"]Lawlor, Ian[/TD]
[TD="class: xl69"]Goalkeeper[/TD]
[TD="class: xl71"]55.77[/TD]

[TD="class: xl67, width: 200"]Leverton, James[/TD]
[TD="class: xl69"]Goalkeeper[/TD]
[TD="class: xl71"]35.00[/TD]

[TD="class: xl67, width: 200"]Lund, Mitchell[/TD]
[TD="class: xl69"]Full Back (Right)[/TD]
[TD="class: xl71"]54.29[/TD]

[TD="class: xl67, width: 200"]Lund, Mitchell[/TD]
[TD="class: xl69"]Central Defender[/TD]
[TD="class: xl71"]51.25[/TD]

</tbody>

Rgs
Steve
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
lets see if we can break it down a bit to make it easier to understand

lets assume the table is from A1 to C7

and your formula you want it to be in G1

=INDEX(A,MATCH(B,C,D))

A = The range of where your result is located, in this example case it would be A1:A7

B = What you want to look up since you have multiple criteria meaning the position and the score you have to separate them with the & sign ... so for this example it would be F1&H1

C = Where you want to look up those value respectively again if multiple criteria, separate with & sign, example above would be B1:B7&C1:C7

D = a 0 for exact match

so in conclusion something like this

=INDEX(A1:A7,MATCH(F1&H1,B1:B7&C1:C7,0))

Also this is an array formula so instead of just hitting enter, you must do CTRL + SHIFT + ENTER
 
Upvote 0
Nine Zero, you're a diamond. Definately going to save that post as i understood what it meant. Whats with the arrays though, the {}, what do they do?
 
Upvote 0
I came up with a nice formula too. ;)

Let's assume you look for the best goalkeeper, but you don't know his score.
This will find the best score within all goalkeepers only, and then will return a name of a player:


Excel 2007
ABC
Lawlor, Ian

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] "]Kongolo, Rodney[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] "]Advanced Playmaker[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"]45[/TD]

[TD="align: center"]2[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] "]Kongolo, Rodney[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] "]Attacking Midfielder[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"]47,92[/TD]

[TD="align: center"]3[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] "]Kongolo, Rodney[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] "]Advanced Playmaker2[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"]45[/TD]

[TD="align: center"]4[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] "]Lawlor, Ian[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] "]Goalkeeper[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"]55,77[/TD]

[TD="align: center"]5[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] "]Leverton, James[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] "]Goalkeeper[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"]35[/TD]

[TD="align: center"]6[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] "]Lund, Mitchell[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] "]Full Back (Right)[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"]54,29[/TD]

[TD="align: center"]7[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] "]Lund, Mitchell[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] "]Central Defender[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"]51,25[/TD]

[TD="align: center"]8[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]9[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]10[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]11[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

</tbody>
SHEET1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Array Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: #E0E0F0"]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: #E0E0F0"]A11[/TH]
[TD="align: left"]{=INDEX(A1:C7,MATCH(MAX(IF(B1:B7="Goalkeeper",C1:C7,0)),C1:C7,0),1)}[/TD]
[/TR]
</tbody>[/TABLE]
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:
Upvote 0
Oops. I found a bug in my formula. I cannot edit my post anymore.
The bug is, that when two players, on a different positions, have the same highest score it will give you a name of the first player with that score. It can be either goalkeeper or advanced playmaker. Whoever is first.
This will give you a proper name:

Excel 2007
A
Lawlor, Ian

<colgroup><col style="width: 25pxpx"><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]11[/TD]

</tbody>
SHEET1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Array Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=E0E0F0]#E0E0F0[/URL] "]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=E0E0F0]#E0E0F0[/URL] "]A11[/TH]
[TD="align: left"]{=INDEX(A1:A7,MATCH("Goalkeeper"&MAX(IF(B1:B7="Goalkeeper",C1:C7,0)),B1:B7&C1:C7,0),1)}[/TD]
[/TR]
</tbody>[/TABLE]
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Another option if you have Excel ver. 2010 or later with the AGGREGATE function. This formula does not require CTRL-SHIFT-ENTER, just ENTER.
Excel Workbook
ABC
1Kongolo, RodneyAdvanced Playmaker45
2Kongolo, RodneyAttacking Midfielder47.92
3Kongolo, RodneyAdvanced Playmaker245
4Lawlor, IanGoalkeeper55.77
5Leverton, JamesGoalkeeper35
6Lund, MitchellFull Back (Right)54.29
7Lund, MitchellCentral Defender51.25
8
9
10GoalkeeperLawlor, Ian55.77
Sheet
 
Upvote 0
I've got it written down so it's like:

INDEX(B3:F3,MATCH(A8,B4:F4,0) - these aren't pertinent to your table.

So B3:F3 is the index - it's the list where your results desired are.
A8 is the Match, or the lookup, like in Vlookup.
B4:F4 is where the lookup is found.


So with an Index Match you tell the formula where your index is, what your match criteria is, then where your match criteria is found.
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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