Selecting the Top 5

FlashGordy

New Member
Joined
Mar 23, 2011
Messages
8
Good Afternoon

I'm new here, but have been using Excel for a while. I've never, however used macros or written code in it before.

What I'm trying to do is build a spreadsheet that has several sheets.

One of these is an Inventory Report, where food figures are entered, and the cost of overusing and underusing each item is calculated.

What I'd like is for my front page (essentially a summary) to display the top 5 over used items, and the top 5 under used items, with the values as well. I would like this to automatically update when I enter new information into my "Inventory Report".

I think this should be possible, I just don't know how.


Thanks in advance
Gordon
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi, welcome to the board.

Take a look at the =LARGE() and =SMALL() functions for identifying the largest and smallest values in a range. They can be used to find, for example, the nth largest value.
 
Upvote 0
Use the LARGE and SMALL function to harvest the Top/Bottom five from your lists.

=LARGE(array,n)

n being 1 to 5, for top 5.

And likewise, =SMALL(array,n)

Beware of ZERO's, uding SMALL. Use a seperate =COUNTIF(array,0), then add to n, to adjust.

Then use a lookup, if more info required from lists using the results from above.
 
Upvote 0
Hi Gerald

That does look like it would work. How would I go about having the Inventory Item's name (from a different column) returned as well without a marathon of IF() functions?

Gordon
 
Upvote 0
Let's say your source table looks like this

Item name (col A)....Value (col B)
Item 1...................10
Item 2.....................9
Item 3...................12

and let's say you want to return the second highest value (item 1).

Code:
=large(b2:b4,2)
will return the value 10.

Then this formula will return the name of the item that has a value of 10.
Code:
=INDEX(A2:A4,MATCH(LARGE(B2:B4,2),B2:B4,0))

Watch out for multiple items having the same value - this may give you unexpected results.
 
Upvote 0

Forum statistics

Threads
1,224,576
Messages
6,179,639
Members
452,935
Latest member
mm1t1

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