I would like to get an cell equation that provides the average of the last three non-zero entries in a range. Given the data
Value Desired Result
1
0
0
2
3 2
0 2
4 3
0 3
5 4
6 5
7 6
8 7
0 7
9 8
0 8
where cell A1="Value" and "A15"=9 etc. Starting with row 6, the average of the last three non-zero entries in column A is 2=(1+2+3)/3 in cell "B6" for the range "A2:A6". In cell "B14", the average is 7=(6+7+8)/3 for the range "A2:A14". I tried to come up with a range that would grow or shrink to get three non-zero cells, but couldn't work it out. HELP!
Value Desired Result
1
0
0
2
3 2
0 2
4 3
0 3
5 4
6 5
7 6
8 7
0 7
9 8
0 8
where cell A1="Value" and "A15"=9 etc. Starting with row 6, the average of the last three non-zero entries in column A is 2=(1+2+3)/3 in cell "B6" for the range "A2:A6". In cell "B14", the average is 7=(6+7+8)/3 for the range "A2:A14". I tried to come up with a range that would grow or shrink to get three non-zero cells, but couldn't work it out. HELP!