Step 1. Calculate the empirical formula
The empirical formula is the simplest whole-number ratio of atoms in a compound.
The ratio of atoms is the same as the ratio of moles.
So, our job is to calculate the molar ratio of #"C"# to #"H"# to #"Cl"#.
Your compound contains 24.27 % #"C"#, and 4.07 % #"H"#.
Assume that you have 100 g of sample.
Then it contains 24.27 g of #"C"# and 4.07 g of #"H"#.
#"Mass of O = (100 - 24.27 - 4.07) g = 71.66 g"#
#"Moles of C" = 24.27 color(red)(cancel(color(black)("g C"))) × "1 mol C"/(12.01 color(red)(cancel(color(black)( "g C")))) = "2.021 mol C"#
#"Moles of H" = 4.07 color(red)(cancel(color(black)("g H"))) × "1 mol H"/(1.008 color(red)(cancel(color(black)("g H")))) = "4.038 mol H"#
#"Moles of Cl" = 71.66 color(red)(cancel(color(black)("g Cl"))) × "1 mol Cl"/(35.45 color(red)(cancel(color(black)( "g Cl")))) = "2.021mol Cl"#
From this point on, I like to summarize the calculations in a table.
#ulbb("Element"color(white)(m) "Mass/g"color(white)(Xl) "Moles"color(white)(Xll) "Ratio"color(white)(m)"Integers")#
#color(white)(m)"C" color(white)(XXXmml)24.27 color(white)(Xml)2.021color(white)(mml)1color(white)(mmmmmll)1#
#color(white)(m)"H" color(white)(XXXXmll)4.07 color(white)(mml)4.038 color(white)(Xmll)1.998 color(white)(mmmll)2#
#color(white)(m)"Cl"color(white)(XXXmm)71.66 color(white)(Xml)2.021color(white)(mml)1.000color(white)(mmmll)1#
The empirical formula is #"CH"_2"Cl"#.
Step 2. Calculate the molecular formula of the compound
The empirical formula mass of #"CH"_2"Cl"# is 49.48 u.
The molecular mass is 98.96 u.
The molecular mass must be an integral multiple of the empirical formula mass.
#"MM"/"EFM" = (98.96color(red)(cancel(color(black)("u"))))/(49.48 color(red)(cancel(color(black)("u")))) = 2.000 ≈ 2#
The molecular formula must be twice the empirical formula.
#"MF" = ("EF")_2 = ("CH"_2"Cl")_2 = "C"_2"H"_4"Cl"_2#