Calculation Issues

Require Integer Decision Variables and Results in Excel Solver

Algirdas JasaitisAlgirdas Jasaitis Nov 18, 2026 868 views

Question details

Configure Excel Solver to find values that satisfy formulas while requiring decision variables and selected calculated results to be whole numbers.

Require Integer Decision Variables and Results in Excel Solver
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.
Before you start

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.

Solution 1Recommended

Add Integer Constraints to Excel Solver Variables

Use this method to require whole-number decision variables and, if needed, whole-number calculated results.

1
Set up Solver

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.

2
Require whole-number variables

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.

3
Handle calculated results

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.

4
Choose a solving method

Select Simplex LP for a linear model or Evolutionary for a nonlinear integer model. Add any other model constraints, then click Solve.

Add Integer Constraints to Excel Solver Variables
Check the model: The int relation applies to decision-variable cells. Alternatively, formulate calculated expressions so they always produce integers. Integer constraints can make a model infeasible if no whole-number solution satisfies the other constraints.
Free Microsoft Office alternative

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.

Open and edit spreadsheets containing formulas and model dataCompatible with Microsoft Excel XLS and XLSX filesUse a familiar interface for a smoother transition from OfficeWork with a free, lightweight office suite
QA img-9

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.