MS Excel Solver: How It Works, Setup, and When to Use It

How-to basics · Updated November 21, 2026

Microsoft Excel Solver is an optimization add-in that finds values for selected cells to maximize, minimize, or reach a target result while meeting constraints. In Excel for Microsoft 365 on Windows, enable it through File > Options > Add-ins, choose Excel Add-ins and select Go, check Solver Add-in, then open Data > Solver to define the problem.

What Excel Solver does

Solver works backward from a goal. You provide an objective cell containing a formula, identify the cells whose values Excel may change, and set any limits those values must obey. Solver then searches for a combination of inputs that meets the limits and improves the objective. It is useful when there are many possible combinations and choosing the best one by trial and error would be impractical.

For example, a business might want to decide how many units of each product to make in order to maximize contribution, without exceeding available labor or materials. Other uses include assigning staff to shifts, selecting a low-cost shipping plan, blending ingredients to meet specifications, or choosing a portfolio of projects under a fixed budget. These are planning examples, not a guarantee that a mathematical model captures every real-world consideration.

Solver is different from Goal Seek. Goal Seek changes one input to reach a specified result in one formula. Solver can change multiple input cells at once and account for constraints. It is also different from a regular Excel formula: a formula calculates an output from inputs, while Solver searches for input values that satisfy a goal.

Availability and enabling the add-in

The standard Solver add-in is available with desktop Excel, but it may not be enabled when you first open Excel. On Windows, use these steps:

  1. Select File > Options, then select Add-ins.
  2. At the bottom, set Manage to Excel Add-ins and select Go.
  3. Check Solver Add-in and select OK. If Excel asks to install or add the feature, follow the prompt.
  4. Open the Data tab and select Solver, usually in the Analysis group.

In Excel for Mac, open Tools > Excel Add-ins, check Solver Add-in, and select OK. Then look for Solver on the Data tab. Names and placement can vary slightly by Excel release. The built-in Solver is not available in Excel for the web, so use the desktop app to create and run a Solver model. A workbook may still contain ordinary formulas that can be viewed or edited in the web app, but that is not the same as running Solver there.

Solver is an Excel add-in rather than a separately purchased Microsoft product in standard desktop installations. Access to desktop Excel itself depends on the reader’s Microsoft 365 plan, workplace or school license, or other Excel license. Third-party optimization add-ins may have different features and pricing; they are not the standard Solver described here.

How a Solver model is structured

A useful model separates inputs, decision variables, calculations, and limits. Decision variable cells hold the values Solver is allowed to change. Formula cells calculate the outcome of those decisions, such as total profit or hours used. Constraints compare calculated values or decision variables with limits, such as available labor, a minimum order, or a required whole-number quantity.

  • Objective: one formula cell to maximize, minimize, or set to a particular numeric value.
  • Changing variable cells: the input cells Solver can adjust.
  • Constraints: conditions the solution must satisfy, such as resource use being less than or equal to capacity.
  • Solving method: the algorithm that searches for a solution, selected to fit the model’s formulas.

Before opening Solver, check that the objective formula actually depends on the decision cells. Also make sure units are consistent: comparing hours with a limit expressed in minutes, for instance, can produce a technically valid but practically wrong model. Solver follows the spreadsheet formulas and constraints you give it; it cannot infer missing business rules or detect that a number was entered in the wrong unit.

Worked example: choosing a product mix

Suppose a small shop makes products A and B. Each A earns 30 units of contribution and uses 2 labor hours and 3 units of material. Each B earns 50, uses 4 labor hours and 2 units of material. The shop has at most 100 labor hours and 90 material units. Let B2:C2 contain the quantities of A and B, with B3:C3 containing their contributions, B4:C4 their labor use, and B5:C5 their material use. The cells B2:C2 are the changing cells; put the following formulas in the calculation cells:

  • With quantities in B2:C2 and unit contributions in B3:C3, put this formula in B6 for total contribution: =SUMPRODUCT(B2:C2,B3:C3)
  • With quantities in B2:C2 and labor per unit in B4:C4, put this formula in B7 for total labor: =SUMPRODUCT(B2:C2,B4:C4)
  • With quantities in B2:C2 and material per unit in B5:C5, put this formula in B8 for total material: =SUMPRODUCT(B2:C2,B5:C5)

In Solver, set the objective to B6 and choose Max. Set By Changing Variable Cells to B2:C2. Add constraints B7 less than or equal to 100, B8 less than or equal to 90, and B2:C2 greater than or equal to 0. In this example the continuous optimum is 20 units of A and 15 of B: labor is 20 × 2 + 15 × 4 = 100, material is 20 × 3 + 15 × 2 = 90, and contribution is 20 × 30 + 15 × 50 = 1,350. This arithmetic checks both resource limits and the objective value. If products must be made in whole units, add an integer constraint to B2:C2; this example’s solution already uses whole numbers.

Setting up and running Solver

Once the worksheet is arranged, select Data > Solver and fill in the Solver Parameters dialog. Set Objective takes the objective cell reference; choose Max, Min, or a specific value. By Changing Variable Cells takes the decision-cell range. Under Subject to the Constraints, select Add to enter each rule. For example, in the product model, set B7 to <= 100 and B8 to <= 90. You can add a range constraint for nonnegative quantities, or use the Make Unconstrained Variables Non-Negative option when appropriate.

After choosing a solving method, select Solve. Solver reports whether it found a solution and offers the choice to keep the Solver solution or restore the original values. Review the result in the sheet rather than treating the completion message as proof that the model is sensible. Recalculate the resource totals, check that each limit is met, and confirm that the resulting decision is usable in the real situation. Save a copy or preserve the starting assumptions before experimenting with a model you need to keep.

Choosing a solving method

The method matters because different algorithms suit different kinds of formulas. The Solver dialog offers three standard methods:

  • GRG Nonlinear: intended for smooth nonlinear models. A nonlinear formula may include products of decision variables, powers, or functions whose behavior is not a straight line. It can find a local optimum rather than prove that no better solution exists elsewhere, so starting values and the model’s shape can matter.
  • Simplex LP: for linear programming models, where the objective and constraints are linear in the changing cells. The product example is linear, so this is the appropriate method. Linear models often have strong guarantees when Solver reports an optimum, provided the model is set up correctly.
  • Evolutionary: for models with discontinuities, non-smooth behavior, or relationships that are difficult for the other methods. It can take longer and may not find the best possible answer, so verify the result and consider whether the worksheet can be reformulated as a simpler linear or smooth model.

If you are uncertain, inspect the formulas and ask whether a small change in a decision variable produces a proportional change in the objective and constraints. If yes, the model may be linear; if not, it may require GRG Nonlinear or Evolutionary. A method cannot repair an incorrect formula or an incomplete set of constraints.

Constraints, integer decisions, and assumptions

Constraints express what a solution is allowed to do. Common relationships are less than or equal to a capacity, greater than or equal to a minimum, and equal to a required total. You can constrain individual cells or ranges. Solver also supports integer and binary restrictions: an integer cell must be a whole number, while a binary cell can take only 0 or 1. These are useful for quantities that cannot be fractional or decisions such as whether to open a site.

Use such restrictions only when the real decision requires them. Requiring every variable to be an integer can make a model harder to solve. Similarly, a nonnegative restriction is not automatically appropriate for every problem: some models legitimately include negative values, such as net changes or signed balances. Write down the assumptions behind each constraint so another person can understand why it is present.

Solver optimizes the formulas in the workbook, not every consequence of a plan. For example, a production model with only labor and material limits might recommend making more units than customers would buy. Add a demand limit if demand matters. If a real constraint is left out, Solver may return a mathematically optimal answer that is operationally unsuitable.

Common problems and how to troubleshoot them

  • Solver is missing: confirm the add-in is checked in Excel Add-ins and reopen the Data tab. If using Excel for the web, switch to desktop Excel; the built-in Solver add-in does not run there.
  • Solver says it cannot find a feasible solution: inspect the limits for conflicts. For example, a rule requiring production of at least 80 units cannot coexist with a capacity that allows at most 60. Check signs, cell references, and units.
  • The answer is unexpectedly extreme: look for a missing bound. If Solver can increase a profitable decision cell without any capacity or demand limit, an unlimited result may be consistent with the model as written.
  • The result looks wrong despite meeting the constraints: verify the objective formula, changing-cell range, and units. Confirm that the objective cell changes when a decision cell changes, and that the formula points to the intended rows and columns.
  • The model is slow or returns different-looking answers: reduce unnecessary complexity, check whether the selected method fits the formulas, and provide sensible starting values. Nonlinear and evolutionary models can be more difficult than straightforward linear ones.

For suitable linear models, Solver can create reports after it finds a solution, including an Answer Report and, when available, a Sensitivity Report. Report availability depends on the model and solving method. A Sensitivity Report is not a universal explanation of every model; it is mainly useful for interpreting certain linear-programming results and the effects of changes to coefficients or limits.

Solver compared with alternatives

Use Goal Seek when there is one input to adjust to make one formula equal a target. Use a data table when you want to see how results vary across a set of possible inputs, rather than have Excel search for the best combination. Solver is the better fit when there are multiple adjustable cells and restrictions that must be respected.

For very large, specialized, or business-critical optimization problems, a dedicated optimization package or a cloud planning service may be more suitable. Such tools can offer larger models, specialized algorithms, or team workflows, but they may require separate licensing or technical setup. Excel Solver is a practical starting point for modest models that fit its capabilities and are easy to inspect in a worksheet.

Frequently Asked Questions

Is Solver included in Microsoft Excel?
The standard Solver add-in is available with desktop Excel, but you may need to enable it. It is not a separate Solver purchase for a standard desktop installation; the Excel license or plan is separate.

Can I use Solver in Excel for the web?
No. The built-in Solver add-in runs in desktop Excel, not Excel for the web. Open the workbook in the Windows or Mac desktop app to set up and run it.

Why does Solver keep giving me a different answer?
Check whether the model is nonlinear or has multiple equally good solutions, and confirm the selected solving method and starting values. Also check that the constraints and formulas express the intended problem; Solver may find another valid optimum if several exist.

Can Solver find an exact answer?
Sometimes, but it depends on the model, the method, and the conditions you provide. A result should be checked against the worksheet’s formulas and real-world requirements. For complex or nonlinear problems, a reported solution does not necessarily establish that it is the global best answer.

What is the difference between Solver and Goal Seek?
Goal Seek adjusts one input to reach a specified output in one formula. Solver can adjust multiple cells and enforce constraints while optimizing an objective, so it handles a broader class of planning problems.

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.