It's not Sum ({@valuect}, {Depname.depdes}) that's the problem... it's Sum ({@grouptotal}, {Depname.depdes}) .... you need to check to see if Sum ({@grouptotal}, {Depname.depdes}) is 0, and if it is, return 0, ELSE do the calculation.

=tg