Select Largest 5 in A, AVG values in B

  • Thread starter Thread starter Phillycheese5
  • Start date Start date
P

Phillycheese5

I'm looking for the formula that will use the largest 5 values in colum
A and average the corresponding values in column B. I tried this...

=AVERAGE(IF(A1:A500>LARGE(A1:A500,5),B1:B500))

which gave me an answer which was close, but not exact as to when I di
it manually; so something is off.

Any help would be appreciated.
Thanks,
Phillycheese
 
The following array formula will return the average of the 5
largest values in B1:B20:

=AVERAGE(LARGE(B1:B20,ROW(INDIRECT("1:5"))))

Since this is an array formula, you must press CTRL+SHIFT+ENTER
rather than just ENTER when you first enter the formula and when
you edit it later. If you do this, Excel will display the formula
in the formula bar enclosed in curly braces {}.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Phillycheese5"
<[email protected]>
wrote in message
news:P[email protected]...
 
You have to use greater than or equal to, instead of just greater than:

=AVERAGE(IF(A1:A500>=LARGE(A1:A500,5),B1:B500))

Still array entered (CTRL+SHIFT+ENTER)
 
Nothing beats self-teaching...

Apparently I need to say "greater than the 6th largest value" whic
would give me the largest 5. In case anyone was interested, here i
the formula that works:

=AVERAGE(IF(B3:B500>LARGE(B3:B500,6),D3:D500)) ...use CSE
 
I'm looking for the formula that will use the largest 5 values in column
A and average the corresponding values in column B. I tried this...

=AVERAGE(IF(A1:A500>LARGE(A1:A500,5),B1:B500))

which gave me an answer which was close, but not exact as to when I did
it manually; so something is off.

Any help would be appreciated.
Thanks,
Phillycheese5


Something like:

=SUMIF(A1:A500,">="&LARGE(A1:A500,5),B1:B500) / 5


--ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top