One possible solution is an if/else test where you test the item that might possibly give you a divide by zero error before you get to that division. Test to see if it is a zero first, if not, then do the test, but if it is, skip the test part.