Formula to Return 5 Highest/Lowest Scores from Pivot Table

marvin jones

Board Regular
Joined
Mar 16, 2016
Messages
86
Hi All,

I have a pivot table which contains a row of months with a column of employees. I have sorted the data with highest scores first, but don't know how to write a formula which returns with the top 5 highest/lowest employees per month.

Also, as in the example below, there are blanks in the pivot due to employees not being in.

Example:[TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]04[/TD]
[TD]05[/TD]
[TD]06[/TD]
[TD]07[/TD]
[/TR]
[TR]
[TD]Driver 1[/TD]
[TD]60.05%[/TD]
[TD][/TD]
[TD]52.01%[/TD]
[TD]61.31%[/TD]
[/TR]
[TR]
[TD]Driver 2[/TD]
[TD]54.82%[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Driver 3[/TD]
[TD][/TD]
[TD]39.49%[/TD]
[TD]51.81%[/TD]
[TD]60.10%[/TD]
[/TR]
[TR]
[TD]Driver 4[/TD]
[TD]50.55%[/TD]
[TD][/TD]
[TD][/TD]
[TD]55.41%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
Please can anybody help.[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]HEIGHEST[/TD]
[TD="align: center"]LOWEST[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]=INDEX(Pivot!A:A,MATCH(BIG(Pivot!B:B,1),Pivot!B:B,0))[/TD]
[TD]=INDEX(Pivot!A:A,MATCH(SMALL(Pivot!B:B,1),Pivot!B:B,0))[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]=INDEX(Pivot!A:A,MATCH(BIG(Pivot!B:B,2),Pivot!B:B,0))[/TD]
[TD]=INDEX(Pivot!A:A,MATCH(SMALL(Pivot!B:B,2),Pivot!B:B,0))[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]=INDEX(Pivot!A:A,MATCH(BIG(Pivot!B:B,3),Pivot!B:B,0))[/TD]
[TD]=INDEX(Pivot!A:A,MATCH(SMALL(Pivot!B:B,3),Pivot!B:B,0))[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]=INDEX(Pivot!A:A,MATCH(BIG(Pivot!B:B,4),Pivot!B:B,0))[/TD]
[TD]=INDEX(Pivot!A:A,MATCH(SMALL(Pivot!B:B,4),Pivot!B:B,0))[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]=INDEX(Pivot!A:A,MATCH(BIG(Pivot!B:B,5),Pivot!B:B,0))[/TD]
[TD]=INDEX(Pivot!A:A,MATCH(SMALL(Pivot!B:B,5),Pivot!B:B,0))[/TD]
[/TR]
</tbody>[/TABLE]

Pivot!B:B refers to month 04 only.
You may refer to ranking cells in BIG() and SMALL() functions instead of numbers.
 
Last edited by a moderator:
Upvote 0
Hi Flashbond,

Thanks for your reply.

I'm getting a #NAME ? error.

=INDEX('Bradford - Data'!V8:V1000,MATCH(BIG('Bradford - Data'!W8:W1000,1),'Bradford - Data'!W8:W1000,0))

The pivot is in the Bradford - Data tab and the first name starts at V8 and the first value starts at W8.

Have i typed the formula incorrectly?

Thank you.
 
Upvote 0
Hi Flashbond,

Thanks for your reply.

I'm getting a #NAME ? error.

=INDEX('Bradford - Data'!V8:V1000,MATCH(BIG('Bradford - Data'!W8:W1000,1),'Bradford - Data'!W8:W1000,0))

The pivot is in the Bradford - Data tab and the first name starts at V8 and the first value starts at W8.

Have i typed the formula incorrectly?

Thank you.

Aahaha :)) Please replace BIG with LARGE

Sorry my bad ;)
 
Last edited by a moderator:
Upvote 0
Hi Again,

The formula which looks at the pivot table to find the smallest value and return the driver name: =INDEX('Bradford - Data'!$V:$V,MATCH(SMALL('Bradford - Data'!$W:$W,3),'Bradford - Data'!$W:$W,0)) is returning an odd value.

The name being returned is of a driver who did not work that month and so has no value. Is this formula assuming no value is the lowest value and therefore returning this driver? Is there a way the small formula above can search by a value of 0% and higher?

Thanks,
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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