Formal charge = Nv - \(\Big[N_l+\frac{N_b}{2}\Big]\)
Carbonyl chloride COCl2

Formal charge on carbon atom = 4 - \(\big[0+\frac{8}{2}\big]\)= 4 - 4 = 0
Formal charge on chlorine atom = 7 - \(\big[6+\frac{2}{2}\big]\) = 7 - 7 = 0
Formal charge on oxygen atom = 6 - \(\big[4+\frac{4}{2}\big]\) = 6 - 6 = 0