if min(of A1-A5) > 0 then test="All A1-A5"; else if min(of A1-A4)>0 and A5=0 then test="A1-A4"; /* your pattern isn't necessarily obvious but perhaps*/ else if min(of A1-A3)>0 and max(A4, A5)=0 then test="A1-A3"; But if you get to A1, A3 and A5 >0 and A2, A4=0 you're not going to find much simplification.
... View more