简体   繁体   中英

Excel Solver - Limit Number of Variables

Here is the problem Excel solver need to change the values of variables a, b, c, d, e, f in a way that it gives the optimization solution considering a constraint that Count of Non Zero values for variables a, b, c, d, e, f should be less than 3

Read through many online articles but didn't find a solution

In Excel, you should have the Solver Add-In (see: this is you do not have it)

Next I created a sheet like this (using control+backquoot to show the formulas)

在此处输入图像描述

After make field G3 active, and click on Data/Solver via the menu.

In Dutch 'Solver' is 'Oplosser', the rest of the text in this screenshot is also in Dutch (you can say thanks to Microsoft for that! (i do not know where you can do that!))

在此处输入图像描述

Anyway, after entering the correct values, and hitting the 'Solve' (or 'Opslossen') button, I do get:

在此处输入图像描述

A correct solution to your problem is: A=4; E=4; F=16 and (B=0; C=0; D=0)

I did assume the numbers in A...F should not have decimals, be: 'geheeltallig'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM