# Have excel average the top x percent of range

I have a range in one column of numbers. I don't want to average the whole range of numbers (~1500 entries), I want to know if there is a way to average a certain percentile.

so for instance if out of the 1500 numbers 160 of them are the top 10% How would I do this?

or If I wanted to know what the average is of the percentile between 10% - 15%.

I imagine that there is a formula where based on my icon set I could specify what the averages for each set of the icon set (that would also be helpful).
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

VBA DeveloperCommented:
Averaging The Highest N Numbers In A Range
To average the N largest numbers in a range, use the array formula

=AVERAGE(LARGE(A1:A60,ROW(INDIRECT("1:10"))))

Change "1:10" to "1:N" where N is the number of values to average.
http://www.cpearson.com/Excel/excelF.htm

http://excelusergroup.org/forums/t/1866.aspx
0
VBA DeveloperCommented:
Remeber, to use the array formula you need to confirm it with Ctrl + Shift + Enter and Excel will add the {} brackets around the formula.
0
VBA DeveloperCommented:
See attached example.
Book2.xls
0
Commented:
To average between 2 percentiles like 10% and 15% you can use an array formula like this
=AVERAGE(IF(A1:A1600>=PERCENTILE(A1:A1600,10%),IF(A1:A1600<PERCENTILE(A1:A1600,15%),A1:A1600)))
confirmed with CTRL+SHIFT+ENTER
regards, barry
0
Commented:
Barry,

>or If I wanted to know what the average is of the percentile between [top] 10% - 15%.

Perhaps that should have been:

{=AVERAGE(IF(A1:A100>=PERCENTILE(A1:A100,85%),IF(A1:A100<=PERCENTILE(A1:A100,90%),A1:A100)))}

Patrick
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Commented:
Yes, Patrick, I reckon you are correct, I took the "between 10% - 15%" too literally......

regards, barry
0
Commented:
teylyn,

Please apportion the points to reflect the more major contribution made by barryhoudini. After all, I only made a minor correction.

Patrick
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.