Try

=IF(SUM(J4:J12),0,SUM(K4:K12))

However, as pointed out by Ford in post #3, this remain zero as long as there is a "1" in column J