Please sort my parrots
May 21, 2008 5:22 AM
Subscribe
Item: one Excel spreadsheet. Contains: fifty rows. Column A - parrot name. Column B - parrot selling price. Column C - parrot age when sold.
Without sorting the rows, how can I find the average age when sold of the most expensive ten parrots? I know I need an array here but just can't work out how to get my correct parrot average.
posted by humuhumu to computers & internet (10 comments total)
4 users marked this as a favorite
lets say if you've got 100 rows in your column for 100 prices and ages
you can use
=rank(B1, $B$1:$B$100,0)
which will give each row a rank based on its rank in among the prices in the price column. you have to copy that down to give a ranking for each of the different rows. lets say in Column D
then you'll have a ranking for each of the different parrots which should be from 1 to 10 for the top ten. changing the 0 to 1 in the formula above puts it the other way around.
then, its an array function.
=AVERAGE(IF(D1:D16<> (and then as you probably know to make it an array formula, press F2 and then control=shift-return).
which gives you the average of ages if the ranking is 10 or below. as long as i've done that alright>
posted by galactain at 5:47 AM on May 21, 2008