Do I need to know the number of moles of each element to determine the formula of the compound?
Yes, you do need to know the number of moles of each element to determine the formula of a compound. By comparing the number of moles of each element in the compound, you will find the simplest formula, called the empirical formula, which gives the lowest whole number ratios of the elements in the compound.
The molecular formula may be the same as the empirical formula, or a multiple of the empirical formula. The molecular formula gives the numbers of atoms of each element in one molecule of the compound. You can only determine the molecular formula if you know the molecular weight (molar mass) of the compound. Refer to the following website for a detailed and step-by-step procedure for determining empirical and molecular formulae. http://pages.towson.edu/ladon/empiric.html