Using Small, Index and Match function when there are numbers the same.

claz2201

New Member
Joined
Feb 4, 2017
Messages
13
Hi there,

I have a document where students scores are inputted in column N:AJ with the column headers as the categories.

I am wanting in columns C:E to pick out the 3 lowest scores and their corresponding categories.

I have used the following formula: =(INDEX($N$1:$AJ$1,MATCH(SMALL(N3:AJ3,1),N3:AJ3,0))) which works for 1 value, but there are multiple values the same. I would like the formula to pick the bottom 3 categories, even when they all score the same.

I've tried to put an example below;
Name1st2ndGraphNumberAlgebraMultiplication
Tony??5322
Jack??0002

<tbody>
</tbody>

Hope you can help!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Excel Workbook
ABCDEFG
1Name1st2ndGraphNumberAlgebraMultiplication
2TonyMultiplicationAlgebra5322
3JackMultiplicationAlgebra0002
Sheet
 
Upvote 0
Hello,

If the three bottom categories do NOT score the same ... you can test following

=INDEX($N$1:$AJ$1,MATCH(SMALL($N$3:$AJ$3,LEFT(C$1,1)),$N$3:$AJ$3,0))

HTH
 
Upvote 0
The formula you mention and the example you post do not agree...

Assuming that Tony is in A2, N1:AJ1 houses categories (items of some sort), and N2:AJ2 the scores of Tony on categories:

In B2 control+shift+enter, not just enter, copy across, and down:

=IF(COLUMNS($B2:B2)>COUNTIFS($N2:$AJ2,"<="&SMALL($N2:$AJ2,MIN(3,COUNT($N2:$AJ2)))),"",INDEX($N$1:$AJ$1,SMALL(IF($N2:$AJ2=SMALL($N2:$AJ2,COLUMNS($B2:B2)),COLUMN($N2:$AJ2)-COLUMN($N2)+1),SUM(IF(SMALL($N2:$AJ2,COLUMN($N2:N2)-COLUMN($N2)+1)=SMALL($N2:$AJ2,COLUMNS($B2:B2)),1)))))

If you must have this in C2, replace $B2:B2 with $C2:C2.
 
Upvote 0
Thank you to Mart37 who has helped me and suggested the following formula, it works a treat!

=INDEX($N$1:$AJ$1,SUMPRODUCT(LARGE(($N3:$AJ3=SMALL($N3:$AJ3,COLUMN()-2))*TRANSPOSE(ROW($1:$23)),COLUMN()-2)))
 
Upvote 0
Spreadsheet Formulas
CellFormula
C3{=INDEX($N$1:$AJ$1,MATCH(SMALL($N3:$AJ3+TRANSPOSE(ROW($1:$23))/1000,COLUMN()-2),
$N3:$AJ3+TRANSPOSE(ROW($1:$23))/1000,0)
)}

<tbody>
</tbody>
Formula Array:
Produce enclosing
{ } by entering
formula with CTRL+SHIFT+ENTER!

<tbody>
</tbody>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,573
Members
449,089
Latest member
Motoracer88

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