All you have to do is set up 2 proportions, where one paint you know and the other you do not know and make it equal to the ratio as 2 blue : 5 yellow
For example: 1 blue/x yellow = 2 blue/5 yellow, and then cross multiply and solve for x.
Do this for all unknowns, blue and yellow paint making it equal to the ratio and solve for the unknown.