REPLACE sum1 WITH d1 + d2 + d3+d4+d5+d6+d7+d8+d9+d10 REPLACE sum2 WITH d11 + d22 + d33+d44+d55+d66+d77+d88+d99 if sum1=0 or sum2 =0 replace sum3 with 0 else if sum1<0 or sum2 <0 = messagebox("this is rong") else replace sum3 with (sum2/sum1)*100 endif endifthanks.