average numbers in sequence
Bill
like Biff I have assumed there will never be less than 5 numbers in a
sequence
my initial solution also assumed you would put the formula in at the
correct point
=AVERAGE(LARGE(OFFSET(O1,0,0,MATCH(TRUE,ISBLANK(O1 :O11),0)),{1,2,3,4,5}))
and like Biff's
Enter this formula in P2 as an array using the key combo of
CTRL,SHIFT,ENTER:
it uses the match to find the position of the first BLANK in a range of 11
cells (so there always is one)
then uses the offset to set the range you will average over
I had a quick try at using Biff's method to enclose this in an IF that
detected blank cells so you can simply copy down
If you are able to insert a blank row at the top of the data paste this
into P2 and copy down
=IF(AND(ISBLANK(O1),ISNUMBER(O2)),AVERAGE(LARGE(OF FSET(O2,0,0,MATCH(TRUE,ISBLANK(O2:O12),0)-1),{1,2,3,4,5})),"")
Also entered as Array
It feels clunky but does the job
hth RES
|