I got this as an extra credit problem for Algebra 1:

Mrs. Wells is a financial analyst for the State of Utah. She has been asked by the finance committee to prepare investment recommendations for the $2,000,000 in a State Employee Retirement Fund. The committee has requested that investments be diversified by allocating the fund among the following: certificates of deposit, treasury notes, blue-chip stock, speculative stock, corporate bonds, and real estate.

Here are the stats for the different investments(sorry the forum formatting won't let me put this in a easier to read format):
% Yield, Risk Factor , Investment Horizon(Years)

CD's: 8.5 , .02 ,8
TN's: 9.0 ,.01 ,2
BC's: 8.5, .38 ,5
SS's: 14.3 ,.45 ,6
CB's: 6.7 ,.07, 2
RE's: 13.0 ,.35 ,4

The constraints:
The state finance committee has indicated it would like to have a weighted average investment period of at least 5 years. They have also indicated that the weighted average risk factor should be no greater than 20%. Regulations prohibit more than 25% of the state's investments being placed in real estate and speculative stock combined. Also, note that she can't invest more than $2,000,000 total.

How to allocate the money to maximize dollar yield?

The hard part of this problem for me, is trying to formulate the two percentage constraints. I don't know how to make a restraint using weighted averages. We're supposed to do this in Excel, so if I could just formulate the constraints I can figure out the maximum easily.

Thank you!