I have 2 columns, col 1 has inputs (0.6, 0.5, 0.7, etc), and col 2 has binary results (0 or 1)... I want to average the "last 10" values from the results column, but only average if the input column is greater than 0.6...
The formula below works great, except it averages the last 10 values regardless if they are >0.60 or not, and I can't figure out a way to only average the last 10 if they meet the >0.6 criteria.
=ArrayFormula(iferror(average(query(if(len(A2:A),{ROW(A2:A),B2:B},),"Select Col2 where Col1>0.60 and Col2>-1 order by Col1 Desc limit 10"))))
(answers that work in Sheets as well would be fantastic)
Thanks in advance!
Bookmarks