if agency Contract X9 has 8 (example) in it the do the calculation which it does,

if the X9 has 0 or is empty then do no calculations and leave the cell that has this formula in blank