Index and match with large function

CorneGeyser

New Member
Joined
Aug 13, 2019
Messages
10
Hi,

I am using the Large function to calculate the rank and Index and Match to return the user name of that rank. Some of the ranks have similar values and then returns only the first name of that rank value.

I would like it to return the correct user name for each rank value.
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
CorneGeyser,

I'm finding it difficult to interpret the question so if you could post examples of your data and formulae that would help.

If I assume you want to list all names where a rank may be the same value (and my assumptions are often wrong) then let me give an example.

Here I have names and scores in columns A & B. In E1 I enter the Rank I want to search (and note in this example Rank=2 or 3 would return the same result, a score of 12). In E2 I use LARGE to find the score for the requested rank.

My solutions in column G, H and I give my suggested formulae.
  • G: As you found a simple INDEX and MATCH will only return the first name from the list, so this fails.
  • H: I can use an array formula (entered using Ctrl-Shift-Enter so Excel puts curly brackets around) then INDEX and SMALL will return the 1st match, then the second, etc.
  • I: Depending on the amount of data an array formula can be slow to run so you can use AGGREGATE and employ the SMALL function (option 15) to get the same result.

ABCDEFGHI
1NameScoreRank=3Who 1?Who 2?Who 3?
2Bert12Number12BertBertBert
3Sue15BertVeraVera
4John7Bert
5Alf11Bert
6Vera12Bert

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

Worksheet Formulas
CellFormula
E2=LARGE(B2:B6,E1)
G2=INDEX($A$2:$A$6,MATCH($E$2,$B$2:$B$6,0))
to G6
Copy&Paste as above
I2
=IF(COUNTIF($B$2:$B$6,$E$2)<ROW()-1,"",INDEX($A$2:$A$6,AGGREGATE(15,6,ROW($B$2:$B$6)/($B$2:$B$6=$E$2),ROW()-1)-1))
to I6
Copy&Paste as above

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Array Formulas
CellFormula
H2{=IF(COUNTIF($B$2:$B$6,$E$2)<ROW()-1,"",INDEX($A$2:$A$6,SMALL(IF($B$2:$B$6=$E$2,ROW($A$2:$A$6)-1),ROW()-1)))}
to H6
Copy&Paste as above

<thead>
</thead><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>


NOTES:
  1. The IF & COUNTIF is to return null once the formula has exhausted valid data to return. COUNTIF will return 2 as there's two entries for rank 12, so I don't want a result in row 4 of the solution.
  2. All the row calculations assume headings in row 1 and data starting from row 2. If that's not the case then more maths would be needed in the formulae.
 
Upvote 0
Sorry for the lack of information.

I have a list of users and a value they spent on a specific category of man hours:

A BCDEF
1Archer, NicoR 8 589.001
Forner, Eleanore

<tbody>
</tbody>
R 112 884.00

<tbody>
</tbody>
2Baker, RobertsR 8 589.002
Erasmus, Michelle

<tbody>
</tbody>
R 25 153.50

<tbody>
</tbody>
3Bosman, WernerR 0.003
Archer, Nico

<tbody>
</tbody>
R 8 589.00

<tbody>
</tbody>
4Burelli, SergioR 7 416.004
Archer, Nico

<tbody>
</tbody>
R 8 589.00

<tbody>
</tbody>
5Cibi, BonganiR 0.005
Archer, Nico

<tbody>
</tbody>
R 8 589.00

<tbody>
</tbody>
6Cilliers, ArmandR 0.006
Burelli, Sergio

<tbody>
</tbody>
R 7 416.00

<tbody>
</tbody>
7De Luca, LauraR 8 589.007
Du Preez, Paul

<tbody>
</tbody>
R 4 972.00

<tbody>
</tbody>
8Du Preez, PaulR 4 972.008
Du Preez, Paul

<tbody>
</tbody>
R 4 972.00

<tbody>
</tbody>
9Erasmus, MichelleR 25 153.509
Bosman, Werner

<tbody>
</tbody>
R 0.00

<tbody>
</tbody>
10Forner, EleanoreR 112 884.0010
Bosman, Werner

<tbody>
</tbody>
R 0.00

<tbody>
</tbody>
11Forte, NicoleR 0.00
12Gates, FrancoR 4 972.00
13Hobson, JoshuaR 0.00
14Holliday, CorneR 0.00

<tbody>
</tbody>

Column A & B is my data. In column D I added the rank from 1 to 10.

ColumnFormula
E=INDEX($A$1:$A$14,MATCH(F2,$B$1:$B$14,0))
F=LARGE($B$1:$B$14,D1)

<tbody>
</tbody>

As you can see in E3:E5 the user "Archer, Nico" is repeated. This is what I am trying to avoid.

P.S. sorry, not sure how to get the formatting right on the forum.
 
Upvote 0
Furthermore, I realized in the formula you suggested for I2 the range $A$2:$A$6, after the COUNTIF(), does not fit in there. Is there something missing or am I misinterpreting the formula?
 
Upvote 0
See if this works for you.


A
BCDEF
1Archer, NicoR 8 589.00



2Baker, Roberts
R 8 589.00

Forner, EleanoreR 112 884.00
3Bosman, WernerR 0.00

Erasmus, MichelleR 25 153.50
4Burelli, SergioR 7 416.00

Archer, NicoR 8 589.00
5Cibi, BonganiR 0.00

Baker, RobertsR 8 589.00
6Cilliers, ArmandR 0.00

De Luca, LauraR 8 589.00
7De Luca, LauraR 8 589.00

Burelli, SergioR 7 416.00
8Du Preez, PaulR 4 972.00

Du Preez, PaulR 4 972.00
9Erasmus, MichelleR 25 153.50

Gates, FrancoR 4 972.00
10Forner, EleanoreR 112 884.00

Bosman, WernerR 0.00
11Forte, NicoleR 0.00

Cibi, BonganiR 0.00
12Gates, FrancoR 4 972.00



13Hobson, JoshuaR 0.00



14Holliday, CorneR 0.00




<colgroup><col style="width:30px; "><col style="width:133px;"><col style="width:107px;"><col style="width:64px;"><col style="width:64px;"><col style="width:137px;"><col style="width:145px;"></colgroup><tbody>
</tbody>


Code:
[TABLE="width: 747"]
<colgroup><col width="747"></colgroup><tbody>[TR]
   [TD="width: 747"]INDEX($A$1:$A$14,AGGREGATE(15,6,(ROW($A$1:$A$14)-ROW($A$1)+1)/($B$1:$B$14=$F2),COUNTIF($F$2:F2,F2)))[/TD]
 [/TR]
</tbody>[/TABLE]

Excel tables to the web >> Excel Jeanie HTML 4
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,614
Messages
6,120,533
Members
448,969
Latest member
mirek8991

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