The formula mass is obtained by adding the masses of each individual atom in the formula of the compound. Because a proper formula is electrically neutral (with no net electrons gained or lost), the ions can be considered atoms for the purpose of calculating the formula mass.