I am trying to average a maximum of 20 expressions (just the current values not over time or anything). But if any of the 20 values are zero I don't included any points in the computation of the average from that point on (ex. if element 9 = 0 then avg 1-8,if element 17 = 0 then avg 1-16. Is there any way of doing this besides using a huge if statement with all the combinations of elements being zero or not (ie... if (element6 = 0, avg(e1,e2,e3...e5),if (element5 = 0,avg(e1,e2,e3,e4)... thanks