Determination of compound percentage in impure samples