View Single Post
  #12   Report Post  
Ken Wright
 
Posts: n/a
Default

LOL - serves me right for staying up late, watching a film and playing on
this damn thing too - Cheers Aladin.

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------

"Aladin Akyurek" wrote in message
...
Ken,

Shoudn't that be:

=AVERAGE(IF(A2:A6=LARGE(A2:A6,C1),B2:B6))

with C1 housing 2, the Top N largest criterion?

Ken Wright wrote:
The following will average all values in Col B that are equal to the top

two
largest values in Col A. that could be anywhere from 2 values in Col A

to
all the values in Col A.

=AVERAGE(IF($A$1:$A$100=LARGE($A$1:$A$100,{1,2}),$ B$1:$B$100))

array entered using CTRL+SHIFT+ENTER

This will NOT just pick the first two values that happen to be equal to

the
top two and just use those (unless there are only two), eg

A B
2 3
4 4
6 2
3 7
6 3
5 8

6, 6, and 5 are equal to the top two largest, so it will average 2,7,3

and
give 4