Anybody any good with Array formulas?

churmie

New Member
Joined
Jan 9, 2014
Messages
44
Hi

I am trying to create a dashboard that gives me the top 5 (and bottom 5) on a number of key metrics. I have put an example table below, but I trying to create a result that will list in order 1-5.

Please assume Category is column A, Product is Column B, etc.

Category ProductService
ToysAction man99.10%
ToysBarbie88.75%
GardenBBQ98.40%
ToysBeanie Bears98.54%
GardenBench89.75%
GamesChess99.64%
GamesDraughts99.89%
GardenGas Cyclinder99.52%
GamesGuess Who24.70%
GardenLantern74.90%
GardenLawn Mower94.50%
ToysMagic cards98.64%
GamesMonopoly84.70%
ToysPokemon100.00%
ToolsScrewdriver99.00%
GardenShed98.50%
ToolsSpanner98.80%
GamesSubbeteo65.46%
ToysSylvanian Family99.25%
ToysTop Trumps93.67%
GamesTrivial Pursuit92.50%

<colgroup><col><col><col></colgroup><tbody>
</tbody>

How could I get the following result? If every time I typed in Toys in the cell adjacent to the Category call below, so it would list the below?

CategoryToys
1Sylvanian Family99.25%
2Action man99.10%
3Magic cards98.64%
4Beanie Bears98.54%
5Top Trumps93.67%

<colgroup><col><col><col></colgroup><tbody>
</tbody>

Many Thanks in advance!!!
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
You can do this with a pivot table. Put the service in the Values area, the product in the rows area and the category in the filters area.
Click in the pivot table and select filter click top 10 and change to 5 items based upon service. Now click on sort and change to largest to smallest.
 
Upvote 0
You can do this with a pivot table. Put the service in the Values area, the product in the rows area and the category in the filters area.
Click in the pivot table and select filter click top 10 and change to 5 items based upon service. Now click on sort and change to largest to smallest.

Hi, yeah I know a pivot would be easy, but I am trying to create a formula, as it is in the form of a dashboard, where I type in a category and everything changes for multiple measures. It needs to be easier and smoother than changing the selection in each pivot.
 
Upvote 0
I'd use a pivot table with Category as the filter, sort the service column Largest to Smallest and apply a Value filter to the Product column to display Top (or Bottom) 5.

Your example is wrong though, the first entry should be Pokémon with 100%.
 
Upvote 0
Hi, here is a formula based option you can try - note the comment about pokemon in the prior post.


Excel 2013/2016
ABCDEFG
1CategoryProductServiceToys
2ToysAction man99%1Pokemon100.00%
3ToysBarbie89%2Sylvanian Family99.25%
4GardenBBQ98%3Action man99.10%
5ToysBeanie Bears99%4Magic cards98.64%
6GardenBench90%5Beanie Bears98.54%
7GamesChess100%
8GamesDraughts100%
9GardenGas Cyclinder100%
10GamesGuess Who25%
11GardenLantern75%
12GardenLawn Mower95%
13ToysMagic cards99%
14GamesMonopoly85%
15ToysPokemon100%
16ToolsScrewdriver99%
17GardenShed99%
18ToolsSpanner99%
19GamesSubbeteo65%
20ToysSylvanian Family99%
21ToysTop Trumps94%
22GamesTrivial Pursuit93%
Sheet1
Cell Formulas
RangeFormula
F2=INDEX($B$2:$B$22,AGGREGATE(15,6,(ROW($B$2:$B$22)-MIN(ROW($B$2:$B$22))+1)/($C$2:$C$22=G2),COUNTIFS($G$2:$G2,G2)))
G2=AGGREGATE(14,6,$C$2:$C$22/($A$2:$A$22=$E$1),E2)
 
Upvote 0
How do I reverse it? The bottom 5? That formula is excellent

You can try this (Basically you just want to put it in the aggregate function to look at Small instead of Large e.g. 14 to 15 the first argument in the formula.



Excel 2010
HIJKLMN
4CategoryProductServiceToysTop 5
5ToysPokemon$ 100.00001Pokemon$ 100.00
6GamesDraughts$ 99.89002Sylvanian Family$ 99.25
7GamesChess$ 99.64003Action man$ 99.10
8GardenGas Cyclinder$ 99.52004Magic cards$ 98.64
9ToysSylvanian Family$ 99.25005Beanie Bears$ 98.54
10ToysAction man$ 99.1000
11ToolsScrewdriver$ 99.0000
12ToolsSpanner$ 98.8000
13ToysMagic cards$ 98.6400
14ToysBeanie Bears$ 98.5400
15GardenShed$ 98.5000ToysBottom 5
16GardenBBQ$ 98.40001Barbie$ 88.75
17GardenLawn Mower$ 94.50002Top Trumps$ 93.67
18ToysTop Trumps$ 93.67003Beanie Bears$ 98.54
19GamesTrivial Pursuit$ 92.50004Magic cards$ 98.64
20GardenBench$ 89.75005Action man$ 99.10
21ToysBarbie$ 88.7500
22GamesMonopoly$ 84.7000
23GardenLantern$ 74.9000
24GamesSubbeteo$ 65.4600
25GamesGuess Who#DIV/0!
Sheet5
Cell Formulas
RangeFormula
M5=INDEX($I$5:$I$25,MATCH($N5,$J$5:$J$25,0))
M16=INDEX($I$5:$I$25,MATCH($N16,$J$5:$J$25,0))
N5=AGGREGATE(14,6,$J$5:$J$25/($L$4=$H$5:$H$25),$L5)
N16=AGGREGATE(15,6,$J$5:$J$25/($L$4=$H$5:$H$25),$L16)


NOTE: the names of the top and bottom 5 I'm not sure if they will work if you have duplicate Service %'s because match only returns the first one
 
Last edited:
Upvote 0
How do I reverse it? The bottom 5?

Hi, as Twollaston eluded to, you just need to change the formula in G2 to:

Worksheet Formulas
CellFormula
F2=INDEX($B$2:$B$22,AGGREGATE(15,6,(ROW($B$2:$B$22)-MIN(ROW($B$2:$B$22))+1)/($C$2:$C$22=G2),COUNTIFS($G$2:$G2,G2)))
G2=AGGREGATE(15,6,$C$2:$C$22/($A$2:$A$22=$E$1),E2)

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

<tbody>
</tbody>

The formula in F2 stays as is and doesn't suffer the drawback quoted below.

not sure if they will work if you have duplicate Service %'s because match only returns the first one
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,749
Members
449,050
Latest member
excelknuckles

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