Require Integer Decision Variables and Results in Excel Solver
Question details
Configure Excel Solver to find values that satisfy formulas while requiring decision variables and selected calculated results to be whole numbers.

- Product
- Microsoft Excel Solver
- Device & OS
- not provided
- Scenario
- A spreadsheet model needs Solver to optimize or reach a target while keeping specified values as integers.
- Observed behavior
- The desired solution uses whole-number decision variables and produces whole-number values in the specified calculated cells.
Identify the objective cell, decision-variable cells, and any calculated cells that must be integers. Check that Solver appears on the Data tab; if it does not, enable the Solver add-in.
Add Integer Constraints to Excel Solver Variables
Use this method to require whole-number decision variables and, if needed, whole-number calculated results.
Go to Data > Solver. Select the objective cell, choose Max, Min, or Value Of, and enter the decision-variable range in By Changing Variable Cells.
Under Subject to the Constraints, click Add. Select the decision-variable range in Cell Reference, choose int from the relation list, and click Add or OK.
If calculated cells B and C must also be integers, create two auxiliary cells and include them in By Changing Variable Cells. Add int constraints to the auxiliary cells, then add equality constraints linking B and C to their respective auxiliary cells.
Select Simplex LP for a linear model or Evolutionary for a nonlinear integer model. Add any other model constraints, then click Solve.

Work With Excel Spreadsheets in WPS Office
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and Excel format support, making it easy to open and edit existing workbooks. It does not configure Microsoft Excel Solver.

Frequently Asked Questions
How do I enable Solver if it is missing from Excel?
In Excel for Windows, go to File > Options > Add-ins, select Excel Add-ins in the Manage box, and click Go. Check Solver Add-in and click OK. Solver should appear on the Data tab.
Can I apply an integer constraint directly to a formula cell?
The int relation applies to decision-variable cells. To require a formula result to be an integer, add an auxiliary decision-variable cell with an int constraint and set it equal to the formula cell.
Which Solver method should I choose for an integer model?
In the Solver Parameters dialog, choose Simplex LP for a linear model. Evolutionary is an option for nonlinear integer models.
Why does Solver say it cannot find a feasible solution?
The integer requirements may conflict with the other constraints. Review the constraints in Data > Solver and check whether any whole-number values can satisfy them together.




