Trial and error is tedious. Use the Rule of 13s:
We're organic chemists, dealing with organic molecules... It's a pretty good bet we've got a lot of carbon and hydrogen atoms - and there are at least as many hydrogen atoms as carbon atoms. Those are our assumptions as we start the rule of 13s
*1C and 1H has an atomic mass of 13 (12 + 1).
*Divide the [M+] peak by 13 to get an integer and a remainder
*98/13 = 7r7
*The integer equals the number of carbon atoms
*7 carbon atoms
*The integer plus the remainder equals the number of hydrogen atoms
*7 + 7 = 14 hydrogen atoms
*One possible molecular formula is C7H14
*If you think there's an oxygen atom in the molecule:
*1 Oxygen atom has atomic mass of 16... so does 1 Carbon atom and 4 Hydrogen atoms
*If we add one oxygen atom to our molecular formula, we need to remove 1C and 4H
*C7H14 + O - CH4 = C6H10O
*If you think there are 2 oxygen atoms... repeat
*C6H10O + O - CH4 = C5H6O2
*If you think there's a nitrogen atom:
*1 Nitrogen atom = 14 amu, so does 1C + 2H
*C7H14 + N - CH2 = C6H12N
*If you think there are 2 nitrogen atoms... repeat
*C6H12N + N - CH2 = C5H10N2
*Combine if you think there are mixtures of N and O
*C7H14 + O + N - C2H6 = C5H8NO
Now, this is only guestimates and approximations. I just used whole number masses... for exact mass to 4 decimal places you could take these possible molecular formula and see if any give the exact mass
*C7H14 = 98.1096
*C6H10O = 98.0732
*C5H6O2 = 98.0368
*C6H12N even MW can't have odd # N
*C5H10N2 = 98.0844
*C5H8NO even MW can't have odd # N
I only had to try 4 masses, not 12. Also, if IR or 13C NMR or 1H NMR tells you you definitely DO have an oxygen or definitely DO NOT have a nitrogen, you can narrow down your possible molecular formulas even more!
Can you use the Rule of 13s to narrow down a molecular formula for 123?