I am trying to create an optimization off a current weight in excel subject to min and max constraints. Below is an image of what I am working with. I also need to limit the number of decimal places to 4. I had tried to use the Excel Solver, which does work, but apparently fails to work when limiting the number of decimal places it can go out.
I was hoping to do this in VBA somehow, but am having a hard time coming up with a starting point. The Min and Max will be subject to change on a monthly basis. So basically it comes down to the following:
- Each ID's updated weight needs to fall within the Min and Max weight
- Each ID's updated weight can go out to a max of 4 decimal places. (i.e 20.05% or 0.2005)
- Updated weights need to total 100%