In Excel, Solver is an add-in that finds values for selected cells to maximize, minimize, or reach a target value in a formula cell while meeting constraints you specify. In Microsoft 365 for Windows, enable it if needed, then open Data > Solver; define the objective, changing cells, and constraints, and choose a solving method.
What Solver in Excel means
Solver is an optimization tool, not a worksheet function named SOLVER. You give it a model: a formula that measures the result you care about, cells Excel is allowed to change, and limits those cells or the calculated results must obey. Solver searches for a set of values that satisfies those limits and improves the objective.
This makes Solver useful for questions with several interdependent choices. For example, a business might ask how many units of each product to make to maximize profit when labor and materials are limited. A planner might allocate staff across shifts subject to coverage requirements. A student might find the least-cost combination of ingredients that meets nutritional targets.
Solver is different from ordinary sorting or filtering. Those features organize existing data; Solver changes decision-variable cells to find a solution to a mathematical model. It is also different from Goal Seek, which adjusts one input to make one formula reach a target. Solver can change multiple inputs and enforce multiple constraints at the same time.
How to enable the Solver add-in
On Excel for Microsoft 365 for Windows, Solver may already be enabled. Look for Solver on the Data tab. If it is missing, use this path:
- Select File > Options.
- Choose Add-ins.
- At the bottom, in the Manage box, select Excel Add-ins, then select Go.
- Check Solver Add-in and select OK. If Excel asks to install or enable it, follow the prompt.
Return to the worksheet and check Data > Solver. In Excel for Mac, the add-in is managed through Tools > Excel Add-ins; select Solver Add-in and confirm. The exact dialog appearance can vary by Excel release, but the Solver controls are opened from the Data tab once enabled. Excel for the web does not run the desktop Solver add-in, so open the workbook in the Excel desktop application to use it.
Build a model before opening Solver
Solver can only work with a model that is represented in worksheet cells. Keep inputs, decision variables, calculated totals, and limits clear and separate. A model should also reflect the real question: a mathematically valid answer is not useful if a cost, capacity, or business rule has been omitted.
Consider a small production example. Product A earns $30 per unit and uses two labor hours and three kilograms of material. Product B earns $50 per unit and uses four labor hours and two kilograms of material. There are 100 labor hours and 90 kilograms of material available. The decision is how many units of each product to make, and the objective is to maximize total profit.
Set up the worksheet with product A and B in A1:B1; units to produce in A2:B2, initially 0; profit per unit in A3:B3, with 30 and 50; labor hours per unit in A4:B4, with 2 and 4; and material per unit in A5:B5, with 3 and 2. Put the calculated totals in column D. With quantities in A2:B2 and profit per unit in A3:B3, enter this in D2 for total profit:
=SUMPRODUCT(A2:B2,A3:B3)
With quantities in A2:B2 and labor requirements in A4:B4, enter this in D3 for labor used:
=SUMPRODUCT(A2:B2,A4:B4)
With quantities in A2:B2 and material requirements in A5:B5, enter this in D4 for material used:
=SUMPRODUCT(A2:B2,A5:B5)
SUMPRODUCT multiplies corresponding values and adds the products. For example, if A2 is 20 and B2 is 15, D2 is 20×30 + 15×50 = $1,350. Those quantities use 20×2 + 15×4 = 100 labor hours and 20×3 + 15×2 = 90 kilograms of material. The arithmetic checks both capacity limits exactly.
Set Solver’s objective, variables, and constraints
With the example worksheet ready, select Data > Solver. In the Solver Parameters dialog, use the following setup:
- Set Objective: D2, the total-profit formula.
- To: choose Max, because the goal is to maximize profit. Choose Min for a cost-minimization problem, or Value Of when a formula must reach a specified number.
- By Changing Variable Cells: A2:B2, the production quantities Solver may alter.
- Subject to the Constraints: add D3 <= 100 and D4 <= 90. Also require A2:B2 >= 0 so Solver does not propose negative production.
- Select a Solving Method: choose Simplex LP for this linear example.
Select Solve and review the Solver Results dialog. If Solver reports a solution, choose Keep Solver Solution to retain the values, or restore the original values if you do not want to keep them. The result for this example is 20 units of A and 15 units of B, for $1,350 in profit. Both resource limits are fully used.
For real work, label the units and limits in nearby cells, and verify that the formulas include every relevant item. If there are fixed costs, minimum order sizes, or other rules, decide how those belong in the model before treating the result as a recommendation.
Choose the right solving method
The solving method matters because Solver needs an approach suited to the formulas in the model. The method selector offers three main choices:
- Simplex LP: for linear models, where the objective and constraints change in a straight-line way with the decision variables. The production example is linear because each unit adds fixed profit and fixed resource use.
- GRG Nonlinear: for many smooth nonlinear models, such as a formula involving products of variables or curves. Results can depend on the starting values, and a solution may be a local optimum rather than the best possible result across every feasible combination.
- Evolutionary: for models with formulas or relationships that are discontinuous or otherwise unsuitable for the other methods. It searches candidate solutions and may take longer; results can depend on its settings and search process.
If the objective and constraints are linear, Simplex LP is generally the natural choice. A wrong method can produce a poor result, fail to converge, or take longer than necessary. If you are unsure, inspect the formulas: IF logic, lookup-based calculations, and rounding can create jumps or discontinuities, while squared terms and other smooth curves are nonlinear.
Integer decisions and other constraints
Many real choices cannot be fractional. A plan for 2.4 delivery vans or 7.6 people is not operationally meaningful. Solver can apply an integer constraint to decision cells, or a binary constraint when a cell must be either 0 or 1, such as whether to open a location. In the constraint dialog, select the relevant relationship for the cell range and choose the integer or binary condition.
Adding integer or binary restrictions can make a model harder to solve, and the best answer may differ from the continuous solution. In the production example, the continuous optimum happens to use whole units already. In another model, Solver might first find a fractional optimum; adding an integer restriction makes it search for a feasible whole-number solution instead.
Other common constraints include minimum output, maximum spending, minimum service coverage, or a total that must equal a fixed target. Check whether a constraint applies to each decision cell or to a calculated total. For instance, a limit of 100 labor hours belongs on the labor-used formula, not directly on the number of product units.
Common Solver problems and how to diagnose them
When Solver fails to give the expected result, the cause is often the worksheet model rather than the optimization concept. Check these points:
- Solver is not on the Data tab: confirm that the add-in is enabled in Excel Add-ins. Excel for the web does not run the desktop add-in.
- The objective cell is a number, not a formula: Solver needs a calculated result that changes when the variable cells change.
- Changing cells do not affect the objective: inspect formula references. If the objective does not depend on a decision cell, adjusting that cell cannot improve the result.
- Constraints make the model impossible: check units, signs, and limits. For example, requiring a total to be at least 100 while also requiring it to be at most 50 leaves no feasible value.
- The method does not fit the formulas: choose Simplex LP for linear models, GRG Nonlinear for smooth nonlinear models, and consider Evolutionary for discontinuous cases.
- The result seems unrealistic: check that nonnegative, integer, or other practical restrictions were added where needed. Solver only obeys rules included in the model.
It is also useful to test the worksheet manually with a few trial values before solving. Confirm that the totals respond as expected and that the constraints use consistent units. Save a separate copy before experimenting with a complicated model, and record the assumptions behind the final result.
Solver compared with Goal Seek and alternatives
Use Goal Seek when there is one target formula and one input to adjust. In Excel for Windows, it is under Data > What-If Analysis > Goal Seek. For example, Goal Seek can find the sales volume that makes a profit formula equal a chosen amount. It does not handle a group of changing cells and a set of simultaneous resource constraints the way Solver does.
Use Solver when you need to optimize an objective across multiple changing cells subject to limits. Use a normal formula, PivotTable, or data analysis feature when the task is calculation, summarization, or comparison of existing records rather than optimization. For a small number of trial scenarios, a data table may be simpler than building a Solver model. These tools answer different questions, so selecting one depends on whether you are exploring scenarios, finding a target, or optimizing under constraints.
Frequently Asked Questions
Where is Solver in Excel?
After enabling the Solver Add-in, find it on the Data tab in the Excel desktop application. On Windows, enable it through File > Options > Add-ins; on Mac, use Tools > Excel Add-ins.
Is Solver already included in Excel?
Solver is available as an Excel add-in, but it may not be enabled by default. If it is absent from the Data tab, turn it on in the Excel Add-ins dialog.
Can Solver change more than one cell?
Yes. The By Changing Variable Cells box can contain a range of decision cells. Solver adjusts those cells while trying to meet the constraints and improve the objective.
Why does Solver say it cannot find a feasible solution?
Usually, the constraints cannot all be satisfied together, or the model is set up incorrectly. Check the limits, units, formula references, and starting assumptions; then test whether any set of values could meet every constraint.
Does Solver work in Excel for the web?
The desktop Solver add-in is not available to run in Excel for the web. Open the workbook in Excel for Windows or Mac and use the desktop add-in.
Is Solver the same as Goal Seek?
No. Goal Seek adjusts one input to make one formula reach a specified value. Solver can optimize a formula by changing multiple cells while respecting multiple constraints.
Related
- Consolidate in Excel: Example, Steps, and Common Issues
- Consolidate Data in Excel Across Multiple Worksheets
- Consolidate Excel Sheets with Power Query: A Practical Guide
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Translate English to Spanish in Google Sheets EasilyTo translate English text into Spanish in Google Sheets, enter =GOOGLETRANSLATE(A2,"en","es") in an empty cell, replacing A2 with…
- Excel Day Trading Journal: Build a Useful Trade LogYes—Excel can track day trades, calculate profit and loss, and help you review whether your strategies and rules…
- Protected Sheets in Google Sheets: Setup and PermissionsA protected sheet in Google Sheets limits which editors can change a whole sheet or selected cells. In…
- Create an Outlook Signature in Word and Add It to EmailCreate your signature in Microsoft Word, copy the finished layout, then paste it into Outlook’s signature settings and…
- Google Sheets Print Area: Set and Print a Cell RangeGoogle Sheets does not have a permanent, Excel-style “Set Print Area” command. To print just part of a…
- How to See Named Ranges in Excel and Check Their CellsTo see a named range in Excel, open Formulas > Name Manager to view its name and the…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.