Comparison of ratios and determining total quantities