Microsoft Excel Solver is an add-in for finding values that optimize a formula while meeting limits you specify. In Excel for Microsoft 365 on Windows, enable it through File > Options > Add-ins, choose Excel Add-ins and select Go, then check Solver Add-in; afterward, open Data > Solver.
What the Solver add-in does
Solver is an optimization tool built into the desktop versions of Excel. It changes selected worksheet cells, called changing variable cells, and recalculates formulas until it finds a solution that maximizes, minimizes, or reaches a target value in another cell. You define the goal and any restrictions; Solver searches for values that satisfy them.
This makes Solver useful for questions that involve choices and trade-offs, rather than just arithmetic. Examples include choosing how many products to make with limited labor, allocating a budget across projects, planning deliveries within capacity limits, or finding a mix of ingredients that meets nutritional requirements at the lowest cost. It is not a forecasting feature, and it does not decide whether the assumptions in a model are realistic.
The add-in is separate from the familiar Excel functions used to calculate a worksheet, but it works with those formulas. It changes input cells and uses the worksheet’s formulas to evaluate each proposed solution. It does not normally rewrite the formulas in your model.
How to enable Solver in Excel
On Excel for Microsoft 365 for Windows, use these steps:
- Select File > Options.
- Choose Add-ins in the left-hand menu.
- At the bottom, set the Manage box to Excel Add-ins and select Go.
- Check Solver Add-in, then select OK. If Excel asks to install or load the add-in, confirm.
- Open the Data tab and select Solver, usually in the Analysis group.
For Excel for Microsoft 365 on Mac, select Tools > Excel Add-ins, check Solver Add-in, and select OK. Then look for Solver on the Data tab. The exact placement can vary slightly with the ribbon layout, but the Solver command is on Data when the add-in is loaded.
Solver is not available as the same built-in add-in in Excel for the web. If you open a workbook in a browser, use Open in Desktop App to run Solver in the installed Windows or Mac version. A Solver result saved in the workbook can still be viewed in the browser, but the web app does not provide the desktop Solver dialog for setting up and solving a model.
The three parts of a Solver model
A basic Solver model has an objective cell, changing variable cells, and constraints. The objective cell contains a formula that measures what you want to improve, such as profit, cost, distance, or time. In Solver, choose whether to maximize it, minimize it, or set it to a specified value.
- Objective: The formula whose result you want to optimize. It must depend, directly or indirectly, on the changing cells.
- Changing variable cells: The inputs Solver is allowed to adjust. These might represent quantities to produce, staff assigned to shifts, or amounts allocated to options.
- Constraints: Rules the solution must obey, such as total hours being no more than available hours, quantities being nonnegative, or decision values being integers.
For instance, an objective could calculate total contribution from product quantities. Constraints might limit the use of labor and materials. Without a constraint on quantity, Solver could suggest unrealistic negative production or an arbitrarily large result. The model needs to express the real boundaries of the decision.
A small production-planning example
Suppose a workshop makes products X and Y. Each unit of X earns 30 units of contribution and uses two labor hours and one material unit. Each unit of Y earns 20, uses one labor hour and two material units. The workshop has 100 labor hours and 80 material units. Put the quantities of X and Y in B2 and C2, their contributions in B3 and C3, and the objective formula in D2. Put the resource coefficients for X and Y in B6:C7, with labor and materials on separate rows; calculate usage in D6:D7 and put the available limits in E6:E7.
With quantities in B2:C2 and contribution values in B3:C3, enter this formula in D2 to calculate total contribution:
=SUMPRODUCT(B2:C2,B3:C3)
With quantities in B2:C2 and the labor coefficients for X and Y in B6:C6, enter this formula in D6 to calculate labor used. Copy it to D7, where the corresponding coefficients are in B7:C7:
=SUMPRODUCT($B$2:$C$2,B6:C6)
In Solver, set the objective to D2 and choose Max. Set B2:C2 as the changing variable cells. Add the constraints D6:D7 <= E6:E7 and B2:C2 >= 0. Choose Simplex LP because the objective and resource calculations are linear, then select Solve.
The optimum is 40 units of X and 20 units of Y. Those quantities use 100 labor hours and 80 material units, exactly meeting both limits, and produce a contribution of 1,600: 40 multiplied by 30 plus 20 multiplied by 20. For comparison, producing only X yields 50 units and 1,500 contribution; producing only Y yields 40 units and 800. This illustrates why Solver can be useful: the best combination is not always the one that looks best when each choice is considered alone.
Choosing a solving method
The method matters because different models have different mathematical shapes. In Solver’s dialog, select a method that fits the formulas and relationships in your worksheet:
- Simplex LP is for linear models. The objective and constraints must change proportionally with the decision cells. It is appropriate for the production example above.
- GRG Nonlinear is designed for smooth nonlinear models, such as ones involving curved relationships. It may find a local optimum, so a different starting point can sometimes lead to a different result.
- Evolutionary is intended for models with discontinuities or other relationships that make the standard methods unsuitable. It can take longer and may not find the best possible solution.
Choosing a method does not fix a poorly specified model. If a supposedly linear model contains nonlinear formulas, or if key restrictions are missing, Solver can return a mathematically valid answer that does not solve the real-world problem. Review the model and the result, not just the completion message.
Building a model that gives useful answers
Start by separating inputs, decision cells, formulas, and limits so the model is easy to inspect. Label units clearly: hours, dollars, units produced, or percentages. Make sure every changing cell actually affects the objective or a constraint; an unrelated cell gives Solver freedom that has no meaningful purpose.
Use constraints to represent genuine requirements. If a decision must be a whole number, add an integer constraint; if a choice is only zero or one, use a binary constraint. These rules can make a model harder to solve, so add them only when they reflect the decision. The checkbox for making unconstrained variables nonnegative can be useful, but explicit constraints can make the intended rules easier to see.
Check units and test the worksheet before running Solver. For example, do not compare labor hours to a capacity entered in minutes. Try a few ordinary values in the decision cells and confirm that the objective and resource formulas recalculate as expected. For a small model, also inspect obvious boundary cases, such as making none of one product or using all capacity on a single option.
When Solver finishes, choose whether to keep the solution or restore the original values. Depending on the model and method, Solver may also offer reports, such as an Answer Report. A Sensitivity Report is particularly associated with linear models solved using Simplex LP and is not available for every model type. Save a copy or preserve the original inputs if you need to compare scenarios.
Limits and common Solver problems
The standard Excel Solver add-in has a limit of 200 changing variable cells. A large planning problem may therefore need a different modeling approach or a more capable optimization product. Solver’s practical speed also depends on the formulas, constraints, method, and number of integer or binary decisions; a model with many such decisions can be much more demanding than a small linear model.
If Solver says it cannot find a feasible solution, check whether the constraints conflict. For example, a requirement to produce at least 100 units cannot coexist with capacity that permits no more than 80. If it reports an unbounded solution, a maximizing model may be missing a realistic upper limit. If results seem implausible, check signs, units, formula references, and whether every important rule was added.
A result that changes between runs or seems dependent on initial values may reflect a nonlinear model with multiple local optima. Review the selected method and consider whether the model is smooth, linear, or discontinuous. For a small nonlinear model, trying reasonable starting values can help reveal whether the result is sensitive to where the search begins. Do not treat a Solver message as proof that the assumptions or data are correct.
Cost and alternatives
Solver is included as an add-in with supported desktop Excel installations; it is not a separate Solver subscription. You still need access to a licensed desktop version of Excel to use the built-in add-in. Be cautious about downloads that claim to be the official Microsoft add-in: check the publisher and source, and avoid installing an unrelated program simply because it uses the Solver name.
For a small model, Excel’s built-in Solver is often sufficient. For larger or specialized optimization problems, alternatives include dedicated optimization software, programming tools with optimization libraries, or a commercial Excel add-in. The right choice depends on model size, required features, and how the solution will be maintained. If the task is just calculating a total or applying a simple rule, an ordinary worksheet formula may be simpler than optimization software.
Frequently Asked Questions
Is Solver already included in Excel?
Yes. Solver is an optional add-in included with desktop Excel. You may need to enable it through Excel Add-ins before its command appears on the Data tab.
Can I use Solver in Excel for the web?
The built-in desktop Solver dialog is not available in Excel for the web. Open the workbook in the Excel desktop app to configure and run the add-in.
Why can’t I see Solver on the Data tab?
The add-in may not be enabled or loaded. On Windows, check File > Options > Add-ins and use the Excel Add-ins Manage option; on Mac, check Tools > Excel Add-ins. Confirm that Solver Add-in is selected.
Does Solver change my formulas?
Solver normally changes the decision cells you specify and recalculates formulas that depend on them. It does not need to replace those formulas to find a solution, but it can overwrite the current values in the changing cells.
What is the difference between Solver and Goal Seek?
Goal Seek changes one input cell to make a formula reach a target value. Solver can change multiple cells and optimize an objective while honoring multiple constraints, making it suitable for more involved allocation and planning problems.
Related
- Excel Split Cell Shortcut: The Fastest Ways to Separate Data
- Excel Split Cell After a Character: Methods That Work
- Excel Solver Tutorial: Build and Solve Better Models
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Merge Cells in Google Sheets: Web and App StepsTo merge cells in Google Sheets, select a rectangular range, then choose Format > Merge cells and pick…
- Excel Save As Shortcut: Windows, Mac, and WebIn Excel for Microsoft 365 on Windows, press F12 to open the Save As dialog. On a Mac,…
- Applying Styles in Word: A Practical GuideTo apply a style in Microsoft Word for Microsoft 365 on Windows, select the text or place the…
- Google Sheets Filter and Sort Formulas With ExamplesIn Google Sheets, use FILTER to return rows that meet a condition and wrap it in SORT to…
- Google Sheets Filter by Last Name: Sort and SearchYes. In Google Sheets in a web browser, select the full table, choose Data > Create a filter,…
- Excel Consolidation Using Power Query: A Practical GuideTo consolidate Excel data with Power Query, go to Data > Get Data, connect to the workbook, folder,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.