Excel Solver for Linear Programming: Setup and Limits

How-to basics · Updated November 21, 2026

Yes—Excel Solver can solve linear programming (LP) models in desktop Excel for Microsoft 365 on Windows. Put the objective and constraint calculations in worksheet cells, open Data > Solver, set the changing cells and constraints, then choose Simplex LP as the solving method.

Solver is useful for finding the best result when resources are limited, such as maximizing production profit subject to labor and material limits. The model must be linear for Simplex LP to apply: the objective and each constraint must be made from constants and variable cells combined through addition, subtraction, and multiplication by constants.

What linear programming means

Linear programming is a method for optimizing a linear objective while meeting a set of linear restrictions. The objective might be to maximize profit, minimize cost, or minimize time. The restrictions, called constraints, describe limits or requirements: available labor, demand, storage capacity, minimum production, or a required balance.

The changing cells represent decision variables—the values Solver is allowed to choose. In a production problem, these might be the number of units of each product. The objective cell calculates the result to maximize or minimize, and other worksheet cells calculate how much of each resource the chosen values use.

For a model to be linear, each variable must have a constant rate of contribution. For example, if each unit of Product A earns $30, the profit from producing A units is proportional to A. A formula that multiplies one changing variable by another, such as A times B, is nonlinear. So are terms such as a changing cell squared, or a relationship whose rate changes with the decision-variable value.

Build a small example in the worksheet

Suppose a workshop makes Products A and B. Each A earns $30 and each B earns $20. A requires two labor hours and B requires one; there are 100 labor hours available. A uses one unit of material and B uses two; there are 80 material units available. Let the changing cells represent quantities of A and B, and assume quantities can be fractional for this initial LP model.

The goal is to maximize total profit. The constraints are 2A + B ≤ 100 for labor, A + 2B ≤ 80 for material, and A and B must be at least zero. With the objective 30A + 20B, the best continuous solution is A = 40 and B = 20. It uses all 100 labor hours and all 80 material units, and returns profit of $1,600. For comparison, producing only A allows 50 units and $1,500 profit; producing only B allows 40 units and $800 profit.

In the worksheet, put the two changing quantities in adjacent cells, such as B2:C2. Put the unit profits in B3:C3, and calculate total profit in a separate cell using SUMPRODUCT. Create separate cells that calculate labor and material use from the quantities and per-unit requirements. Keep the input data separate from the decision cells where practical, so it is easier to review what Solver is allowed to change.

Enable Solver and enter the model

Solver is an Excel add-in. In Excel for Microsoft 365 on Windows, enable it through File > Options > Add-ins. At the bottom, set Manage to Excel Add-ins, choose Go, select Solver Add-in, and choose OK. Then open the Data tab and select Solver. The add-in normally needs to be enabled only once for the installation.

In the Solver Parameters dialog, set up the model in this order:

  1. Set Objective: select the cell that calculates total profit.
  2. Choose Max to maximize profit, Min to minimize a cost, or Value Of when the objective must equal a particular number.
  3. By Changing Variable Cells: select the cells for the quantities of A and B.
  4. Choose Add to enter the labor and material limits, and add non-negativity requirements if they are not handled by the non-negative setting.
  5. Under Select a Solving Method, choose Simplex LP, then choose Solve.

For the example, the labor-use cell is constrained to be less than or equal to 100, and the material-use cell is constrained to be less than or equal to 80. The decision cells must be nonnegative. Solver uses the formulas in the worksheet to evaluate each proposed set of quantities; the formulas should refer to the changing cells, not contain fixed copies of their current values.

Why choose Simplex LP

Simplex LP is the Solver method intended for linear models. It searches the feasible region—the set of values that satisfy every constraint—and identifies an optimum for the stated objective when one exists. A linear model’s feasible region has a useful geometric structure: if a finite optimum exists, at least one optimal solution occurs at a corner point. The Simplex method moves through candidate corner solutions rather than checking every possible combination of values.

Solver also offers methods for other kinds of problems. GRG Nonlinear is for certain smooth nonlinear models, while Evolutionary is intended for more complex or discontinuous models. Choosing one of those methods does not make a nonlinear worksheet model linear; it changes the approach Solver uses. For an LP, select Simplex LP so the method matches the model.

A useful model check is to inspect the objective and constraint formulas. A total such as unit profit multiplied by a changing quantity and then added across products is linear if unit profit is fixed. A rule that includes quantity A multiplied by quantity B is not. If the business rule truly includes such interactions, it may need a nonlinear method or a different mathematical formulation.

Continuous, integer, and binary decisions

Basic LP variables can take fractional values. That is appropriate for divisible quantities such as hours, tons, or liters, but may not make sense for whole products, staff members, or vehicles. Solver can add integer restrictions to decision cells; a binary restriction limits a cell to 0 or 1, often to represent whether an option is selected.

Adding integer requirements changes the problem from a continuous linear program to a mixed-integer linear program. The relationships may still be linear, but the solver must respect discrete choices, and the result can take longer to find. A continuous solution of 40.5 units is not a valid answer if the real decision requires whole units. Do not simply round a continuous answer and assume it remains optimal or satisfies all constraints; rounding can break a capacity limit or miss a better feasible integer combination.

In Solver, add an integer constraint by choosing the changing-cell range and selecting the integer relation in the constraint dialog. Use a binary restriction only when the decision really is yes/no. For a simple continuous LP, avoid extra restrictions that do not reflect the real problem, since unnecessary constraints can complicate solving and interpretation.

Check the answer, not just the Solver message

When Solver reports a solution, review the worksheet values and the Solver result dialog. In many cases, choose Keep Solver Solution to retain the proposed values. Then confirm that the objective cell has the expected result and that each constraint is satisfied. In the example, labor use should equal 100, material use should equal 80, and the objective should equal $1,600.

Also check whether the solution makes practical sense. A mathematically valid result can still be unusable if the model omitted a business rule, used the wrong units, or treated a fixed cost as variable. A quantity that should be an integer needs an integer constraint. A minimum order requirement needs a lower-bound constraint. An omitted capacity limit cannot be inferred by Solver.

After solving, Solver may offer reports such as Answer, Sensitivity, or Limits, depending on the model and solution. The Sensitivity report is especially relevant to a continuous linear model: it can show how changes in some constraint limits or objective coefficients affect the current solution within stated ranges. Shadow prices and allowable ranges are conditional model results, not universal predictions; they do not account for changes outside the model or automatically apply to integer-constrained solutions.

Common problems and practical limits

  • Solver is missing: Check that Solver Add-in is enabled in Excel Add-ins, then look on the Data tab. Solver is a desktop Excel add-in and is not available in Excel for the web in the same way.
  • The model is marked nonlinear: Look for changing cells multiplied together, powers of changing cells, or formulas with changing rates. Replace them with a valid linear formulation only if that accurately represents the problem.
  • There is no feasible solution: The constraints may conflict. Check units, signs, and bounds. For example, a required minimum greater than a stated capacity can make the model impossible.
  • The result is unbounded: The objective may be able to improve indefinitely because a necessary limit is missing. Review whether every relevant resource or decision variable has the correct bounds.
  • The answer looks fractional: Add integer constraints if the real decisions require whole numbers; do not assume the continuous LP automatically enforces them.
  • Solver takes too long or cannot handle the model: Simplify unnecessary formulas and constraints, and check whether the model is within the add-in’s practical capacity. Larger models may need a dedicated optimization tool.

The built-in Solver is convenient for worksheet-sized models, but it is not a substitute for checking the formulation. Some models may also be limited by the Solver add-in’s scale, available memory, or the number and type of decision variables and constraints. If the problem is large or operationally important, document the assumptions and verify the result independently.

Excel Solver compared with other tools

Excel Solver is a good starting point when the inputs and outputs already live in a workbook and the model is modest in size. It lets readers see the decision cells, formulas, and constraints directly, which can make a model easier to explain to colleagues who use Excel. It can be less convenient for automated, repeated optimization or very large models.

For larger linear or integer programs, dedicated optimization software or a modeling package may offer more capacity and control. OpenSolver is a separate Excel add-in that can be used for larger linear and mixed-integer models; it is not the built-in Solver add-in, so check its current documentation and compatibility before relying on it. Programmers may instead use optimization libraries in languages such as Python. The right alternative depends on model size, automation needs, licensing, and the expertise available to maintain the model.

On a Mac, Solver is also available as an Excel add-in in supported desktop versions, but the setup route differs: use Tools > Excel Add-ins, select Solver Add-in, and open Solver from the Data tab. Excel for the web does not provide the same desktop Solver workflow, so use desktop Excel or another compatible optimization tool to solve the model.

Frequently Asked Questions

Can Excel Solver solve linear programming problems?

Yes. Use the desktop Solver add-in and select Simplex LP as the solving method. The objective and constraints must be linear in the changing cells for this method to fit the model.

Where is Solver in Excel for Microsoft 365?

After enabling Solver Add-in through File > Options > Add-ins on Windows, find it on the Data tab. On Mac, enable the add-in through Tools > Excel Add-ins, then look on the Data tab.

What is the difference between Simplex LP and GRG Nonlinear?

Simplex LP is designed for linear objective and constraint relationships. GRG Nonlinear is intended for certain smooth nonlinear models. Choose based on the actual formulas and structure of the problem, not simply on which method returns a result.

Can Solver require whole-number answers?

Yes. Add an integer constraint for decisions that must be whole numbers, or a binary constraint for yes-or-no decisions. These restrictions can make solving more demanding than the continuous version of the model.

Why does Excel Solver say it cannot find a feasible solution?

Usually the constraints cannot all be met at once, or a formula, cell reference, unit, or inequality direction is wrong. Check the limits against one another and test whether any plausible set of decision values can satisfy every restriction.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.