Question about extracting data from a pivot - top 5 results

MarkTheRed

New Member
Joined
Jan 5, 2017
Messages
7
Hello everyone,

First time posting here, i am really hoping someone could help me with this, because i have no idea how to proceed further here.

I am trying to extract top 5 numbers from 2 categories in a pivot, i have named them grade 1 and grade 2 (please see screenshot attached, since i am unable to attach anything to the post). I am able to extract the top values using =large (if someone has a better idea i am open to suggestions).

My issue is, i simply cannot find a way to match the values to the names that go with them. The sort pivot options won't work because of the two categories.

Please pay in mind that i wish to avoid using any macros at all, so i am trying to find a solution via a simple formula. In the worst case, i can simply create 2 pivots but that's really not my goal here if i can avoid it.

Any help would be really appreciated in my learning curve in excel :).

Thank you all in advance.



screen.png
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hi,

take a look at this:


Excel 2016 (Windows) 64 bit
ABCDEF
1nameTypeGrade 1Grade 2
2Ana17251
3Mark13466
4Nicole28534
5John19391
6Marcus28532
7Stephen18550
8James14133
9Jack26149
10Phil26982
11Sam14135
12Jackie26286
13Melisa14374
14Johnson28836
15
16
17
18Top 5Grade 2 T1Top 5Grade 2 T2
19John91Jackie86
20Melisa74Phil82
21Mark66Jack49
22Ana51Johnson36
23Stephen50Nicole34
Sheet1
Cell Formulas
RangeFormula
B19=INDEX($A$2:$A$14,MATCH(C19,$D$2:$D$14,0))
E19=INDEX($A$2:$A$14,MATCH(F19,$D$2:$D$14,0))
C19{=LARGE(IF($B$2:$B$14=1,$D$2:$D$14),ROW()-18)}
F19{=LARGE(IF($B$2:$B$14=2,$D$2:$D$14),ROW()-18)}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Hi,

take a look at this:

Excel 2016 (Windows) 64 bit
ABCDEF
1nameTypeGrade 1Grade 2
2Ana17251
3Mark13466
4Nicole28534
5John19391
6Marcus28532
7Stephen18550
8James14133
9Jack26149
10Phil26982
11Sam14135
12Jackie26286
13Melisa14374
14Johnson28836
15
16
17
18Top 5Grade 2 T1Top 5Grade 2 T2
19John91Jackie86
20Melisa74Phil82
21Mark66Jack49
22Ana51Johnson36
23Stephen50Nicole34

<tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
B19=INDEX($A$2:$A$14,MATCH(C19,$D$2:$D$14,0))
E19=INDEX($A$2:$A$14,MATCH(F19,$D$2:$D$14,0))

<tbody>
</tbody>

<tbody>
</tbody>

Array Formulas
CellFormula
C19{=LARGE(IF($B$2:$B$14=1,$D$2:$D$14),ROW()-18)}
F19{=LARGE(IF($B$2:$B$14=2,$D$2:$D$14),ROW()-18)}

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


Hello,

This is a marvelous solution, and thank you for that, although i am not sure it would work for me. From the looks of it, this one does not have any pivots, and the pivots are essential. Let me explain: The real data that i work with contains a lot, lot more data, and they are divided into weeks and months. The pivots are there to ensure that, for reporting purposes, we can filter the week/month that we need, and i need the formulas to match everything once the pivots are set, because they are originally intended to be used by people that have very little to no knowledge of Excel.
Apologies for omitting the week/month part, i did not think it through in detail at the time of writing the post. Also, if it means anything to you, i am using Excel 2010.

Thanks in advance, Filip
 
Upvote 0
Hello,

This is a marvelous solution, and thank you for that, although i am not sure it would work for me. From the looks of it, this one does not have any pivots, and the pivots are essential. Let me explain: The real data that i work with contains a lot, lot more data, and they are divided into weeks and months. The pivots are there to ensure that, for reporting purposes, we can filter the week/month that we need, and i need the formulas to match everything once the pivots are set, because they are originally intended to be used by people that have very little to no knowledge of Excel.
Apologies for omitting the week/month part, i did not think it through in detail at the time of writing the post. Also, if it means anything to you, i am using Excel 2010.

Thanks in advance, Filip

After testing out a bit i see the lack of my knowledge, index match seems to be working for me, once again thank you very much for taking the time to help me out.

Kind regards, Filip
 
Upvote 0

Forum statistics

Threads
1,214,605
Messages
6,120,473
Members
448,967
Latest member
visheshkotha

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