before the average, check if the variable =0, if it is print an appropriate message or value (has to be the same as the average, so either the average becomes a string or the appropriate value is 0 (probably))
If the average is not in a formula, make a formula for it like:
if sum({table.field}, {group}) = 0 then
0
else
someNumber / sum({table.field},{group})