i'm trying to use excel solver to optimize a portfolio.

the problem is that i am not able to model the problem correctly: it maximizes the expected return of the portfolio using all the variables, but i would like to use not all the 234 stocks i listed but 10 at max.

any idea how to force him to produce solutions that use only a subset of the variables available?

thanks in advance