# Minimum acceptable value with solver

#### MyManGeorge

##### New Member
Hello!

I'm using solver for stock portfolio optimization. The solver changes weights to achieve maximum expected return. I have set the following constraints: The portfolio should consist of at least 5 stocks (out of 10) and maximum weight assigned for one stock is 30%. In this case the solver gives the following weights to five stocks: 30%/30%/30%/9,9999%/0,0001%.

I want to add one more constraint which would be that if a stock is assigned to the portfolio, the minimum assigned weight is at least 5%. So what I want is for the solver to figure out that if the assigned weight is not 0% (excluding the stock from the portfolio), it should be at least 5%.

This is something I cannot figure out, so I'm turning to this forum for help.

Thank you!

George

### Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

Replies
1
Views
786
Replies
1
Views
300
Replies
1
Views
1K
Replies
1
Views
1K
Replies
2
Views
322

1,195,924
Messages
6,012,321
Members
441,690
Latest member
CyberWrek

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back