Numerical Solver in Excel: How It Works and When to Use It

How-to basics · Updated November 21, 2026

Yes—Excel includes Solver, an add-in that can numerically find values for selected cells to maximize, minimize, or reach a target in a formula cell while meeting constraints. In Excel for Microsoft 365 on Windows, enable it through File > Options > Add-ins, choose Excel Add-ins beside Manage, select Go, check Solver Add-in, and click OK; then open Data > Solver to set up a model.

What a Numerical Solver Does in Excel

Solver is a numerical optimization tool. You give it an objective cell containing a formula, one or more variable cells it may change, and optional constraints that describe acceptable values. It repeatedly calculates the workbook and searches for values that improve the objective without violating those constraints. The result is a numerical solution, not a symbolic derivation of an equation.

For example, a business might want to choose how many units of two products to make to maximize profit, while staying within limits on labor and materials. The objective is total profit; the changing cells are the production quantities; and resource limits become constraints. Solver can also minimize cost, reduce error, or find values that make a calculated result equal a target.

Solver is useful when there are several adjustable inputs or restrictions. For a simple question such as what single input makes a formula equal a target, Excel’s Goal Seek is often quicker. Solver can handle that kind of target too, but its strength is optimizing across multiple variables and constraints.

Enable Solver and Open It

In desktop Excel for Microsoft 365 on Windows, Solver may already be enabled. If Data > Solver is missing, use File > Options > Add-ins. At the bottom of the window, set Manage to Excel Add-ins, click Go, select Solver Add-in, and click OK. After it loads, Solver appears on the Data tab, usually in the Analyze group.

On a Mac, use Tools > Excel Add-ins, select Solver Add-in, and confirm. Solver is then available from the Data tab, although the dialog layout can differ from Windows. Solver is not available as the desktop add-in in Excel for the web; open the workbook in the desktop application to use it. Solver is included with desktop Excel rather than requiring a separate purchase.

If enabling the add-in produces an error or the checkbox is unavailable, an organization’s Office settings may restrict add-ins. Check with the Microsoft 365 administrator or use an approved desktop installation. Do not assume the absence of the Solver button means the worksheet itself is damaged.

Build a Small Optimization Model

A sound model separates decision variables, calculations, and limits. Consider a simplified example: product A earns 30 units of profit per item and uses two units of a resource; product B earns 20 units of profit and uses one. There are 100 units of that resource. A second resource is limited to 80 units, with product A using one unit and product B using two. The aim is to maximize profit, and quantities must be nonnegative.

Put the quantity of product A in B2 and product B in C2. Enter starting guesses such as 0 in both cells. With those quantities in B2 and C2, put the total profit in D2 using =30*B2+20*C2. Put the first resource use in D3 with =2*B2+C2, and the second resource use in D4 with =B2+2*C2. These formulas make the objective and resource use update whenever Solver changes B2 or C2.

For this layout, the model’s objective is D2, the changing cells are B2:C2, and the resource constraints are D3 less than or equal to 100 and D4 less than or equal to 80. The nonnegativity rule means both quantities must be at least zero. If Solver chooses A = 40 and B = 20, profit is 30 × 40 + 20 × 20 = 1,600; resource use is 2 × 40 + 20 = 100 and 40 + 2 × 20 = 80. Both limits are met exactly.

This is an illustrative mathematical example, not a recommendation about real production or business decisions. In a real workbook, the formulas and constraints should reflect the actual definitions, units, and operating rules. A model that omits a relevant limit can return a mathematically valid answer that is not useful in practice.

Set Solver Parameters and Run It

After laying out the formulas, select Data > Solver. The Solver Parameters dialog asks for the objective, the direction of optimization, the variable cells, and any constraints. For the example above, enter the following:

  1. Set Objective: select the profit formula cell, D2.
  2. Choose Max to find the highest profit. Choose Min for a cost or error you want to reduce, or Value Of when you want the objective cell to reach a particular number.
  3. By Changing Variable Cells: select B2:C2.
  4. Click Add to enter D3 <= 100 and D4 <= 80. Add B2:C2 >= 0, or select Make Unconstrained Variables Non-Negative if that option is appropriate for the model.
  5. Choose Simplex LP for this linear model, then click Solve. Review the result and choose Keep Solver Solution if it meets your needs.

When a model is saved, Solver settings are stored with the worksheet, so reopening the Solver dialog can show the existing setup. Keep the objective and constraint formulas visible in the sheet; a clearly labeled model is much easier to review than a dialog full of unexplained cell references. Save a separate copy before making major changes to a model you need to preserve.

Choose the Right Solving Method

The solving method should match the mathematics in the worksheet. Choosing a method just because it appears first can lead to an unsuitable result or a message that Solver cannot find a solution.

  • Simplex LP is intended for linear models: the objective and constraints are linear expressions in the changing cells. The product example is linear. It is usually the right choice for straightforward allocation, blending, and scheduling models when their formulas meet that condition.
  • GRG Nonlinear is intended for smooth nonlinear formulas, such as a model containing squared terms or other continuously changing relationships. It may find a local solution rather than the best solution over every possible region, so the starting values can matter.
  • Evolutionary can be useful for models with discontinuities, IF-based decisions, or other irregular behavior that does not suit the other methods. It searches more broadly and may take longer; results can depend on settings and the quality of the model.

A formula such as a product of two changing cells is nonlinear, even if it looks simple. A formula with a rounding or branching rule can also make the search less smooth. For a model with integer or binary decisions, add the appropriate integer or binary constraint to the changing cells; do not assume Solver will choose whole numbers automatically. Check the available constraint choices and method guidance in the Solver dialog for the model and Excel version in use.

Constraints, Starting Values, and Model Design

Constraints express what a solution is allowed to do. Common examples include a total that cannot exceed a capacity, a variable that must be at least a minimum, equality between supply and demand, and a decision that must be an integer. Use the correct comparison: a limit of no more than 100 is <= 100, while a requirement to use exactly 100 is = 100. A mistaken equality can make a feasible problem impossible; a missing limit can produce an unrealistic answer.

Use cells for inputs and formulas rather than typing key assumptions into many separate formulas. Label each input with its unit, such as hours, items, or dollars, and keep the units consistent across calculations and constraints. Avoid accidental circular references: a changing cell should feed the calculation, not be defined by a formula that depends on the objective it is meant to control.

For nonlinear models, try sensible starting values and, when appropriate, run Solver again from different starting points. If runs produce different answers, that can indicate multiple local solutions or a difficult model. Compare the objective values and check every constraint independently. A Solver success message is evidence that its search met its stopping criteria, not proof that the model represents reality or that a global best solution has been found.

Common Solver Problems and What to Check

  • Solver says no feasible solution: Check whether constraints conflict, whether a required equality is too strict, and whether cell references point to the intended formulas. Test the model with a simple set of values to see if any combination can satisfy the limits.
  • The result looks unreasonable: Confirm units, signs, bounds, and the objective direction. For example, selecting Min instead of Max can reverse the intended goal. Add realistic bounds that are part of the actual problem rather than accepting extreme values.
  • Solver returns a different result on another run: In a nonlinear model, the starting values and local search can affect the outcome. Try justified starting values and compare feasible results; do not treat one run as conclusive.
  • The formulas do not change as expected: Verify that the correct cells are listed under By Changing Variable Cells and that objective and constraint formulas refer to those cells. Also check that calculation is not relying on a disconnected or hard-coded value.
  • The model is too slow: Reduce unnecessary formula complexity, use a suitable method, and avoid including cells that do not affect the objective or constraints. A large or irregular model may take longer and may require a specialized optimization tool.

It is useful to test a model with known or deliberately simple cases. For instance, temporarily loosen a capacity limit and confirm that the expected decision variable can increase. Then restore the real limit and rerun Solver. Keep a record of assumptions and results when the workbook will be reviewed or reused.

Solver Compared with Goal Seek and Other Options

Goal Seek works backward from one formula result by changing one input cell. It is a good fit for questions like “what interest rate makes this calculated payment equal a target?” when the model has only one adjustable input and no collection of constraints. Solver supports multiple changing cells and constraints, and can optimize an objective instead of only reaching a target. For a single-variable target, find Goal Seek through Data > What-If Analysis > Goal Seek in desktop Excel for Windows.

Excel’s Analysis ToolPak is different: it provides statistical and engineering analysis tools, not a general replacement for Solver’s constrained optimization. For larger, specialized, or repeatedly automated optimization work, organizations may use dedicated optimization software or a programming library. Those alternatives can offer different algorithms and capacities, but they also require their own setup and validation. The right tool depends on the model size, mathematical structure, and how the results will be used.

Frequently Asked Questions

Is Solver already in Excel? Solver is an add-in included with desktop Excel, but it may need to be enabled before the Solver button appears on the Data tab. Excel for the web does not provide the desktop Solver add-in.

Can Excel Solver solve an equation? Yes, if you put the equation’s difference in a formula cell and ask Solver to make that cell equal zero by changing one or more inputs. This is numerical, not symbolic, and there can be multiple roots or no solution. Starting values and suitable bounds can matter.

Why does Solver give different answers for the same worksheet? Nonlinear models can have multiple local solutions, and some search methods can be sensitive to starting values. Check feasibility and objective values, try reasonable alternative starting points, and examine whether the model contains discontinuities or missing constraints.

Can Solver use whole numbers? Yes. Add an integer constraint for decisions that must be whole numbers, or a binary constraint for yes-or-no decisions, where supported by the selected Solver setup. Without such a constraint, a result such as 3.6 may be valid to Solver even when a real-world quantity must be an integer.

Is Solver the same as Goal Seek? No. Goal Seek changes one input to reach a target in one formula. Solver can change multiple cells, obey constraints, and maximize or minimize an objective, making it suited to broader optimization 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.