View Single Post
  #9   Report Post  
Biff
 
Posts: n/a
Default average numbers in sequence

Hi!

I looked up Help, and it doesn't mention an array as a second argument of
LARGE.


Help doesn't mention a lot of things!

I can't explain why you would get an error message like that if the formula
was entered properly. Is the syntax correct?

I'll send you a sample file if you'd like. Just let me know where to send
it.

As a test, try this:

Enter some random numbers in A1:A10.

Then enter this formula:

=AVERAGE(LARGE(A1:A10,{1,2,3,4,5}))

Does that work?

Biff

"Stefi" wrote in message
...
Hi Biff,

I tried to understand and test your formula (in XL2000 and XL2003), but I
got a formula error message at the second argument of the LARGE function:
{1,2,3,4,5}

I looked up Help, and it doesn't mention an array as a second argument of
LARGE.

Would you explain it?

Thanks,
Stefi

"Biff" wrote:

Hi Bill!

Will there always be at least 5 numbers to average?

I have a solution but the result is placed next to the last cell that is
not
blank. Like this:

O P
1 2
2 20
3 4
4 6
5 14
6 12
7 8
8 10
9 16
10 18 16 (result)
11 blank cell


Enter this formula in P1:

=(O1="")*1

Enter this formula in P2 as an array using the key combo of
CTRL,SHIFT,ENTER:

=IF(O2="",0,IF(AND(O2<"",O3=""),AVERAGE(LARGE(IND IRECT("O"&MAX((P$1:P1<"")*(ROW(P$1:P1)))):O2,{1,2 ,3,4,5})),""))

Copy down as needed.

You can hide the result of the formula in cell P1 by setting the font
color
to be the same as the background color.

Biff

"bill gras" wrote in message
...
I have cells O1 to O300 numbers in random sequences of no more than 10
I need to average the 5 highest numbers in each sequence eg:

O P
1 2 16 (result)
2 20
3 4
4 6
5 14
6 12
7 8
8 10
9 16
10 18
11 blank cell
12 15 9 (result)
13 3
14 6
15 12
16 9
17 blank cell
18 blank cell
19 4 23 (result)
20 16
21 20
22 40
23 8
24 11
25 28
26 blank cell
down to 300 rows, the sequence of numbers can be from 1 to 10 but never
more than 10
I got a function :
=IF(COUNT(O1:O10=10,AVERAGE(LARGE(O1:O10,{1,2,3,4 ,5})),"
") but that works only for 10 numbers and not for less

Can some one help please

bill
--
bill gras