Index and Match on Multiple Columns with Duplicate Values

wsr429

New Member
Joined
Mar 18, 2023
Messages
9
Office Version
  1. 2016
Platform
  1. MacOS
Hi, I have a spreadsheet which I created on Excel for Mac (version 16.16.27). It contains 5 Names (A2:A6). Each Name has 5 Rounds in B2:F6.

I used the Large function to get the 3 largest Rounds:

I2 contains the largest Round (=LARGE($B2:$F6,1)) which = 5.6 (found in E3).
I3 contains the second largest Round (=LARGE($B2:$F6,2)) which also = 5.6 (found in D6).
I4 contains the third largest Round (=LARGE($B2:$F6,3)) which = 5.56 (found in B4).

Now I want to identify the Name associated with each of the 3 largest Rounds.

H2 accurately identifies the Name as Alex as the person with the highest Round (=5.6) using this formula:
=INDEX($A$2:$A$6,MATCH(1,MMULT(--($B$2:$F$6=I2),TRANSPOSE(COLUMN($B$2:$F$6)^0)),0))

H3 also returns the Name as Alex using the below formula. However, it should have returned the Name as Jacob since 2nd highest Round of 5.6 belongs to him (D6).
=INDEX($A$2:$A$6,MATCH(1,MMULT(--($B$2:$F$6=I3),TRANSPOSE(COLUMN($B$2:$F$6)^0)),0))

H4 accurately identifies the Name as Brian as the person with the 3rd highest Round (=5.56) using this formula:
=INDEX($A$2:$A$6,MATCH(1,MMULT(--($B$2:$F$6=I4),TRANSPOSE(COLUMN($B$2:$F$6)^0)),0))

Obviously, my formula doesn’t account for duplicate Rounds. Is there a way to correct this shortcoming?

I adapted the formula for the Name lookup from my web search, but I don't understand it's details.

Thanks for your help,

William

PS - attached is a screen print of my spreadsheet
 

Attachments

  • Index and Match on Multiple Columns.jpeg
    Index and Match on Multiple Columns.jpeg
    239.2 KB · Views: 12

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Try:
This is an array formula and you may need to use COMMAND+RETURN (I think that's what you use on a Mac), but with the AGGREGATE function that may not be needed.

Book1
ABCDEFGHI
1NameRound 1Round 2Round 3Round 4Round 5NamesHighest Rounds
2Aiden5.515.54.974.964.11Jacob5.6
3Alex4.925.235.135.65.47Alex5.6
4Brian5.563.025.154.934.92Brian5.56
5Christian4.615.195.535.235.04
6Jacob5.495.125.65.374.25
Sheet1
Cell Formulas
RangeFormula
H2:H4H2=INDEX($A$2:$A$6,AGGREGATE(14,6,(ROW($A$2:$A$6)-ROW($A$2)+1)/($B$2:$F$6=I2),COUNTIF($I$2:I2,I2)))
I2I2=LARGE($B$2:$F$6,1)
I3I3=LARGE($B$2:$F$6,2)
I4I4=LARGE($B$2:$F$6,3)
 
Upvote 0
Solution
Thank you so much, AhoyNC! Your solution worked perfectly. I appreciate your prompt and accurate reply. Thanks again! William

 
Upvote 0
You're welcome. Thanks for the feedback.
I forgot to tell you that you can just drag the formula down as needed.
 
Upvote 0
Thanks for your additional instruction. I was able to apply your formula to my spreadsheet. I double checked the results and now I have the data that I wanted. You are an Excel wiz and I am blessed to be the recipient of your expertise. Thank you for being willing to assist me. I would have never been able to figure this out on my own. Thanks again!
 
Upvote 0

Forum statistics

Threads
1,222,091
Messages
6,163,853
Members
451,861
Latest member
Lurch65

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