Formula to Find Highest Values

pwill

Active Member
Joined
Nov 22, 2015
Messages
406
Hi can anyone help with a Formula?

I am using column A1:A21 as a reference column and I have a list of values in column B1:B21.
I want to find the first 7 highest values in column B and have the results auto show in D1:J1 using the reference from column A

ie

the results in D1:J1 using the references from column A for the first 7 highest values in column B would be


<tbody>
[TD="align: center"]
[/TD]
[TD="width: 64, align: center"] A [/TD]
[TD="width: 64, align: center"] B [/TD]
[TD="width: 64, align: center"] C [/TD]
[TD="width: 64, align: center"] D [/TD]
[TD="width: 64, align: center"] E [/TD]
[TD="width: 64, align: center"] F [/TD]
[TD="width: 64, align: center"] G [/TD]
[TD="width: 64, align: center"] H [/TD]
[TD="width: 64, align: center"] I [/TD]
[TD="width: 64, align: center"] J [/TD]
[TD="width: 64, align: center"] K [/TD]
[TD="width: 64, align: center"] L [/TD]

[TD="align: center"] 1 [/TD]
[TD="align: center"] 0
[/TD]
[TD="align: center"] 7 [/TD]
[TD="align: center"]
[/TD]
[TD="align: center"] 0
[/TD]
[TD="align: center"] -1 [/TD]
[TD="align: center"] 6 [/TD]
[TD="align: center"] -2 [/TD]
[TD="align: center"] -3 [/TD]
[TD="align: center"] -9 [/TD]
[TD="align: center"] -10 [/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]

[TD="align: center"] 2 [/TD]
[TD="align: center"] 1 [/TD]
[TD="align: center"] 2 [/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]

[TD="align: center"] 3 [/TD]
[TD="align: center"] -1 [/TD]
[TD="align: center"] 6 [/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]

[TD="align: center"] 4 [/TD]
[TD="align: center"] 2 [/TD]
[TD="align: center"] 1 [/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]

[TD="align: center"] 5 [/TD]
[TD="align: center"] -2 [/TD]
[TD="align: center"] 4 [/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]

[TD="align: center"] 6 [/TD]
[TD="align: center"] 3 [/TD]
[TD="align: center"] 0 [/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]

[TD="align: center"] 7 [/TD]
[TD="align: center"] -3 [/TD]
[TD="align: center"] 3 [/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]

[TD="align: center"] 8 [/TD]
[TD="align: center"] 4 [/TD]
[TD="align: center"] 0 [/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]

[TD="align: center"] 9 [/TD]
[TD="align: center"] -4 [/TD]
[TD="align: center"] 0 [/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]

[TD="align: center"] 10 [/TD]
[TD="align: center"] 5 [/TD]
[TD="align: center"] 1 [/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]

[TD="align: center"] 11 [/TD]
[TD="align: center"] -5 [/TD]
[TD="align: center"] 0 [/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]

[TD="align: center"] 12 [/TD]
[TD="align: center"] 6 [/TD]
[TD="align: center"] 5 [/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]

[TD="align: center"] 13 [/TD]
[TD="align: center"] -6 [/TD]
[TD="align: center"] 0 [/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]

[TD="align: center"] 14 [/TD]
[TD="align: center"] 7 [/TD]
[TD="align: center"] 0 [/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]

[TD="align: center"] 15 [/TD]
[TD="align: center"] -7 [/TD]
[TD="align: center"] 1 [/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]

[TD="align: center"] 16 [/TD]
[TD="align: center"] 8 [/TD]
[TD="align: center"] 0 [/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]

[TD="align: center"] 17 [/TD]
[TD="align: center"] -8 [/TD]
[TD="align: center"] 1 [/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]

[TD="align: center"] 18 [/TD]
[TD="align: center"] 9 [/TD]
[TD="align: center"] 0 [/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]

[TD="align: center"] 19 [/TD]
[TD="align: center"] -9 [/TD]
[TD="align: center"] 2 [/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]

[TD="align: center"] 20 [/TD]
[TD="align: center"] 10 [/TD]
[TD="align: center"] 0 [/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]

[TD="align: center"] 21 [/TD]
[TD="align: center"] -10 [/TD]
[TD="align: center"] 2 [/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]

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

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

</tbody>


Any help would be much appreciated

Regards
pwill
 
Last edited:

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.
Just thought I would add that the same results could also be shown as

[TABLE="class: cms_table"]
<tbody>[TR]
[TD="align: center"]
[/TD]
[TD="width: 64, align: center"]A[/TD]
[TD="width: 64, align: center"]B[/TD]
[TD="width: 64, align: center"]C[/TD]
[TD="width: 64, align: center"]D[/TD]
[TD="width: 64, align: center"]E[/TD]
[TD="width: 64, align: center"]F[/TD]
[TD="width: 64, align: center"]G[/TD]
[TD="width: 64, align: center"]H[/TD]
[TD="width: 64, align: center"]I[/TD]
[TD="width: 64, align: center"]J[/TD]
[TD="width: 64, align: center"]K[/TD]
[TD="width: 64, align: center"]L[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]-1[/TD]
[TD="align: center"]-2[/TD]
[TD="align: center"]-3[/TD]
[TD="align: center"]6[/TD]
[TD="align: center"]-9[/TD]
[TD="align: center"]-10[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[/TR]
</tbody>[/TABLE]

with the order following the references as in column B ie ref 6 has value 5 but could be placed as above

regards
pwill
 
Last edited:
Upvote 0
Just thought I would add that the same results could also be shown as

[TABLE="class: cms_table"]
<tbody>[TR]
[TD="align: center"]
[/TD]
[TD="width: 64, align: center"]A[/TD]
[TD="width: 64, align: center"]B[/TD]
[TD="width: 64, align: center"]C[/TD]
[TD="width: 64, align: center"]D[/TD]
[TD="width: 64, align: center"]E[/TD]
[TD="width: 64, align: center"]F[/TD]
[TD="width: 64, align: center"]G[/TD]
[TD="width: 64, align: center"]H[/TD]
[TD="width: 64, align: center"]I[/TD]
[TD="width: 64, align: center"]J[/TD]
[TD="width: 64, align: center"]K[/TD]
[TD="width: 64, align: center"]L[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]-1[/TD]
[TD="align: center"]-2[/TD]
[TD="align: center"]-3[/TD]
[TD="align: center"]6[/TD]
[TD="align: center"]-9[/TD]
[TD="align: center"]-10[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[/TR]
</tbody>[/TABLE]

with the order following the references as in column B ie ref 6 has value 5 but could be placed as above

regards
pwill



Sorry that should have been D1:J1

regards
 
Last edited:
Upvote 0
Could we use some helper cells? I have used D2:J2. Both formulas copied across.


Book1
ABCDEFGHIJ
1070-16-2-31-9
2127654322
3-16
421
5-24
630
7-33
840
9-40
1051
11-50
1265
13-60
1470
15-71
1680
17-81
1890
19-92
20100
21-102
High Values
Cell Formulas
RangeFormula
D1=INDEX($A1:$A21,AGGREGATE(15,6,(ROW($A1:$A21)-ROW($A1)+1)/($B1:$B21=D2),COUNTIF($D2:D2,D2)))
D2=LARGE($B$1:$B$21,COLUMNS($D2:D2))
 
Upvote 0
In D1 control+shift+enter, not just enter, and copy across (as long as you need)...

=IFERROR(INDEX($A$1:$A$21,SMALL(IF($B$1:$B$21=LARGE($B$1:$B$21,COLUMNS($D$1:D1)),ROW($B$1:$B$21)-ROW($B$1)+1),
SUM(IF(LARGE($B$1:$B$21,COLUMN($D$1:D1)-COLUMN($D$1)+1)=LARGE($B$1:$B$21,COLUMNS($D$1:D1)),1)))),"")
 
Upvote 0
Hi peter,

Thanks for your reply I will give this a try and let you know how I get on.

much appreciated :)

regards
pwill
 
Upvote 0
In D1 control+shift+enter, not just enter, and copy across (as long as you need)...

=IFERROR(INDEX($A$1:$A$21,SMALL(IF($B$1:$B$21=LARGE($B$1:$B$21,COLUMNS($D$1:D1)),ROW($B$1:$B$21)-ROW($B$1)+1),
SUM(IF(LARGE($B$1:$B$21,COLUMN($D$1:D1)-COLUMN($D$1)+1)=LARGE($B$1:$B$21,COLUMNS($D$1:D1)),1)))),"")



Thanks Aladin Akyurek,

I will give this a try also and let you know how I get on.

much appreciated :smile:

regards
pwill
 
Upvote 0

Forum statistics

Threads
1,223,705
Messages
6,173,988
Members
452,541
Latest member
haasro02

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