- On the Tools menu, click Solver.
If the Solver command is not available on the Tools menu, you need to load the Solver add-in (add-in: A supplemental program that adds custom commands or custom features to Microsoft Office.) program.
- Add or make changes to constraints.
Add a constraint
- In the Solver Parameters dialog box, under Subject to the Constraints, click Add.
- In the Cell Reference box, enter the cell reference (cell reference: The set of coordinates that a cell occupies on a worksheet. For example, the reference of the cell that appears at the intersection of column B and row 3 is B3.) or name (name: A word or string of characters that represents a cell, range of cells, formula, or constant value. Use easy-to-understand names, such as Products, to refer to hard to understand ranges, such as Sales!C20:C30.) of the cell range for which you want to constrain the value.
- Click the relationship ( <=, =, >=, Int, or Bin ) that you want between the referenced cell and the constraint (constraints: The limitations placed on a Solver problem. You can apply constraints to adjustable cells, the target cell, or other cells that are directly or indirectly related to the target cell.). If you click Int, "integer" appears in the Constraint box. If you click Bin, "binary" appears in the Constraint box.
- In the Constraint box, type a number, a cell reference or name, or a formula (formula: A sequence of values, cell references, names, functions, or operators in a cell that together produce a new value. A formula always begins with an equal sign (=).).
- Do one of the following:
- To accept the constraint and add another, click Add.
- To accept the constraint and return to the Solver Parameters dialog box, click OK.
- You can apply the Int and Bin relationships only in constraints on adjustable cells.
- When the Assume Linear Model check box on the Solver Options dialog box is selected, there is no limit on the number of constraints. For nonlinear problems, each adjustable cell can have up to 100 constraints, in addition to bounds and integer restrictions on the variables.
Change or delete a constraint