To determine the formula of an ionic compound, balance the charges of the cations (positive ions) and anions (negative ions) so that the overall charge of the compound is neutral.