Type a molecular formula and read its degree of unsaturation: how many rings and π bonds the formula allows, together, before a single structure is drawn. It is the first thing to compute from a formula and the fastest way to rule a structure out.
The calculator shows the arithmetic rather than only the answer, so the halogens, the nitrogens and the charge each visibly do what they do to the count.
A degree of unsaturation is rings plus pi bonds. Read it off a molecular formula, count it off a structure you draw, and compare the two: they part company whenever sulfur or phosphorus is drawn beyond the valence the formula assumes. The tool needs JavaScript; these are the pages it offers: