Excel: Solver Error Value in a Target or ConstraintLast reviewed: June 9, 1997Article ID: Q90185 |
4.x 5.00 5.00c 7.00 | 4.00 5.00
WINDOWS | MACINTOSHkbusage The information in this article applies to:
SUMMARYIn Microsoft Excel, when setting constraints for a Solver problem, if you type the word "integer" (without the quotation marks) in the Constraint box in the Add Constraint dialog box, Solver fails.
MORE INFORMATIONExcel Solver finds solutions to problems such as maximizing profits or adjusting expenditures to fit within a given budget. When using Solver, you specify various parameters, including constraints on the values that can be used. One possible constraint is "integer," which tells Solver that the number must be a positive or negative whole number or zero. For example, if you're selling cars, you don't want Solver to tell you that the way to trim your budget is to sell only half a car or -3 cars. In this case, you want to constrain the number of cars sold to an integer value that is greater than, or equal to, 0 (zero). When adding constraints to your Solver model in the Add Constraint dialog box, if you type the word "integer" into the Constraint box and choose the Add button, Solver adds your constraint; however, if you then choose the OK button in the Add Constraint dialog box, Solver displays the message:
Constraint must be a number, simple reference, or a formula with a numeric value.When you choose the OK button in this message box, Solver returns you to the Add Constraint dialog box. If you then choose the Cancel button (or if you originally chose the Cancel button after choosing Add) in the Add Constraint dialog box, Solver returns you to the Solver Parameters dialog box. If you now choose the Solve button in the Solver Parameters dialog box, Solver attempts to find a solution but fails. Solver displays the Solver dialog box containing the error message:
Solver encountered an error value in a target or constraint cellTo properly constrain a value to an integer, select "int" from the list that contains the comparison operators (<=, = >=) in the Add Constraint dialog box. Notice that when you select int from the list, Solver enters the word "integer" in the Constraint box.
REFERENCES"Microsoft Excel User's Guide 2," version 4.0, pages 79-120
|
KBCategory: kbusage
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |