If you're given the weights of three elements, that make up a compound, then by dividing these weights by the atomic weights of the elements involved you get the proportions of the elements involved. For example if the answers you get to the divisions are 15.9, 16.1 and 32.2 then you're looking at 1:1:2.
If you're given the percentages directly then you are at the final stage given above. The figures in this case would be 25%, 25%and 50% giving you the same 1:1:2 result as before.