Thanks for the help; really appreciate it. Both solutions work, but the one from Aladin is "more general" so will serve my purpose. I made the problem smaller for illustration, but as i use this formula i'll have alot more rows, so it would be hard to put a hard-coded array within the formula.
I would like to ask this, in way of trying to understand this formula and how it works. Do not need this for getting the solution to work (thats great!); it is just a way to attempt to increase my understanding!
I changed the input data slightly to make sure it worked for negative numbers, and if a number was repeated in the range. So, now the data in A1:A8 is: 1, -10, 100, -45, 5, 200, 5, 87.
I put it in Excel's stepwise "Evaluate formula" feature, and here is the stepwise output and my comments. Where i did not understand, i made the comment in red. If anybody could respond to these questions, or in some other way describe "how this formula works", would appreciate it very much!
1=MATCH(TRUE,N(OFFSET($A$1:$A$8,ROWS($A$1:$A$8)-1,0,-(ROW($A$1:$A$8)-ROW($A$1)+1))) < 6,0) 'initial
2=MATCH(TRUE,N(OFFSET($A$1:$A$8,8-1,0,-(ROW($A$1:$A$8)-ROW($A$1)+1))) < 6,0) '8 rows
3=MATCH(TRUE,N(OFFSET($A$1:$A$8,7,0,-(ROW($A$1:$A$8)-ROW($A$1)+1))) < 6,0) '8-1=7
4=MATCH(TRUE,N(OFFSET($A$1:$A$8,7,0,-({1;2;3;4;5;6;7;8}-ROW($A$1)+1))) < 6,0) 'rows expanded as array
5=MATCH(TRUE,N(OFFSET($A$1:$A$8,7,0,-({1;2;3;4;5;6;7;8}-{1}+1))) < 6,0)
'row $A$1 is 1, but why is it returned as an array instead of a scalar value?
6=MATCH(TRUE,N(OFFSET($A$1:$A$8,7,0,-({0;1;2;3;4;5;6;7}+1))) < 6,0) 'performed array addition of -1, adds -1 to each element
7=MATCH(TRUE,N(OFFSET($A$1:$A$8,7,0,-{0;1;2;3;4;5;6;7}+1)) < 6,0) 'evaluated within ()
8=MATCH(TRUE,N(OFFSET($A$1:$A$8,7,0,-{1;2;3;4;5;6;7;8})) < 6,0) 'added scalar +1 to each element
9=MATCH(TRUE,N(OFFSET($A$1:$A$8,7,0,-({
#VALUE ;
#VALUE ;
#VALUE ;
#VALUE ;
#VALUE ;
#VALUE ;
#VALUE ;
#VALUE }))) < 6,0)
'Why did #VALUE result?
10=MATCH(TRUE,N({
#VALUE ;
#VALUE ;
#VALUE ;
#VALUE ;
#VALUE ;
#VALUE ;
#VALUE ;
#VALUE }) < 6,0) 'Converted the OFFSET range to an array, all values in array remain as
#VALUE
11=MATCH(TRUE,N((87;5;200;5;-45;100;-10;1} < 6,0) 'The range described by OFFSET is returned as the data in the range on the sheet, reverse order.
'Very hard to see how array of #VALUE values got back to worksheet and could pick up correct values
12=MATCH(TRUE,{87;5;200;5;-45;100;-10;1} < 6,0) 'Evaluated N() function
13=MATCH(TRUE,{FALSE,TRUE,FALSE,TRUE,FALSE,FALSE,FALSE,FALSE,},0) 'Expression "<6" evaluated against each value in array
14=2 'MATCH finds position of first TRUE VALUE
Thanks much!