In the example in the previous post, we were able to work out the moles of H, O, and C in the sample. But that doesn't tell us the moles of the sample. For example, 14 moles of C could be contained in one mole of C14H28O4 or could be contained in two moles of C7H14O2. In this example we can only derive the empirical formula, while we need the molecular mass to derive the molecular formula.
In a modern lab, the molecular mass is determined using a mass spectrometer. But the oldschool methods are also good to know:
Titration: This can be used if the sample is an acid. Since we know the moles used in the titrant, and we know the ratio of the reaction, we therefore know the number of moles of the sample. Dividing the sample mass by the moles gives us the molecular weight.
Vapor density method: This can be used if the sample is a gas. One mole of an ideal gas will occupy 24000 cm3 at standard pressure/temperature, so we can use the volume to determine the number of moles in a given mass of gas.
Many gases deviate from ideal, but determining the molecular weight can be done with rough numbers. For example, if we had the empirical formula H2O, we know that the molecular weight has to be 18, 36, 54, 72... So an inaccurate experimental value of 22 is still good enough to tell us that the molecular weight is 18 and the molecular formula is therefore H2O.
Cryoscopic method: This measures the freezing point depression when a known quantity of solid is dissolved in a liquid - which is a function of the solid's molecular weight.
Vapor pressure osmometry: This measures the change in the vapour pressure of a liquid when a known amount of solid is dissolved it - which is a function of the solid's molecular weight.