What is the formula for calculating no of lone pairs of any compound?
Get hybrid orbitals first-
1/2[V+M+A-C]
Where,
V-valence electrons of main atom
M-Monovalent atoms(H,F,Cl,Br,I)
A-Anionic charge(if any)
C-cationic charge(if any)
Then finally,
Lone pairs= hybrid orbitals-attached atoms.
Its very simple...