To add parameters in Excel Solver, open Data > Solver, choose the objective cell and the changing variable cells, then select Add under “Subject to the Constraints” to enter each limit. Solver calls these settings a model: the changing cells are the decision variables, while constraints set the rules they must follow.
What “parameters” means in Solver
Excel Solver does not have a separate command or field called “Add parameters.” People often use “parameters” to mean the values or rules that define an optimization problem. In Solver’s dialog, the central settings are the objective cell, the cells Solver may change, and the constraints those cells must satisfy. The values in ordinary worksheet cells—such as costs, capacities, rates, or demand—are inputs to the model, rather than settings that you add individually in the Solver dialog.
This distinction matters because Solver needs a worksheet model to calculate outcomes. You put assumptions and formulas on the sheet, then tell Solver which cells it is allowed to change and what result it should optimize. For example, a business might let Solver choose how many units of two products to make, while fixed profit-per-unit and available-hours figures remain worksheet inputs.
If Solver is not visible on the ribbon, it may simply be disabled. The classic Solver add-in is a desktop Excel feature; Excel for the web does not run the classic Solver add-in. On Windows, enable it through File > Options > Add-ins. At the bottom, set Manage to Excel Add-ins, select Go, check Solver Add-in, and choose OK. Then look for Data > Solver.
How the Solver model is organized
A useful Solver model has three connected parts. First, an objective formula measures what you want to maximize, minimize, or set to a particular value. Second, changing variable cells contain the decisions Solver can adjust. Third, constraints describe limits or requirements, such as a resource cap, a minimum order, or a requirement that a decision be an integer.
The objective formula must depend, directly or through other formulas, on the changing cells. If changing a decision cell cannot affect the objective, Solver has no meaningful way to improve it. Likewise, a constraint normally compares a formula cell with a limit or another cell. Keeping inputs, decisions, and calculated totals in clearly labeled worksheet cells makes the model easier to check and revise.
Solver is not the same as Goal Seek. Goal Seek changes one input to make one formula reach a specified value. Solver can change multiple cells and account for multiple constraints while maximizing or minimizing an objective. If there is no objective to optimize and you only need to find an input that produces a target, Goal Seek may be the simpler tool.
Prepare the worksheet before adding settings
Build and test the worksheet calculations before opening Solver. A small production example shows the layout. Suppose a shop makes Product A and Product B. Put the units to produce in B2:C2, profit per unit in B3:C3, labor hours per unit in B4:C4, and material units per product in B5:C5. Enter 40 and 30 in B3:C3, 2 and 1 in B4:C4, and 1 and 2 in B5:C5. Start B2:C2 at zero; these are the decision cells.
With those labels and values in place, enter the total-profit formula in B7, total labor used in B8, and total material used in B9. The formula for total profit, assuming decision quantities are in B2:C2 and unit profits are in B3:C3, is =SUMPRODUCT(B2:C2,B3:C3). It calculates 40 times the quantity of Product A plus 30 times the quantity of Product B. With the starting quantities at zero, the result is 0.
For the resource calculations, assuming quantities remain in B2:C2 and labor hours per unit are in B4:C4, enter this formula in B8: =SUMPRODUCT(B2:C2,B4:C4). It returns the labor used. Assuming material per unit is in B5:C5, enter this formula in B9: =SUMPRODUCT(B2:C2,B5:C5). These formulas also return 0 when both production quantities are zero. Put the available labor and material limits in labeled cells, such as E8 = 100 and E9 = 80, so the limits are visible and easy to update.
Add the objective, changing cells, and constraints
In Excel for Microsoft 365 on Windows, choose Data > Solver. In the Solver Parameters dialog, fill out the model in this order:
- Set Objective: select the cell containing the objective formula, B7 in the example.
- To: choose Max to maximize profit, Min to minimize a cost, or Value Of when the objective must reach a particular number.
- By Changing Variable Cells: select B2:C2, the two production quantities Solver is allowed to alter.
- Subject to the Constraints: choose Add, select B8 as the cell reference, choose “<=” as the relation, and enter E8 as the constraint. Select Add again to enter B9 <= E9, then choose OK when the constraints are entered.
- Check Make Unconstrained Variables Non-Negative if quantities should not fall below zero, and select an appropriate solving method before choosing Solve.
In this example, the two constraints limit labor to 100 hours and material to 80 units. The model’s result is 40 units of Product A and 20 of Product B: that uses 100 labor hours and 80 material units, and the profit formula returns 2,200. These quantities satisfy both limits. If production must be in whole units, add another constraint for B2:C2 and choose int as the relation; otherwise Solver may return fractional quantities in other models.
To add another rule later, reopen Solver, select Add, enter the cell reference, relationship, and constraint value or cell reference, then confirm it. Select an existing rule to change or delete it. A constraint may compare one cell with a number or another cell, and some rules can apply to a range of cells.
Choose a solving method that matches the model
The solving method affects how Solver searches for an answer. Choose Simplex LP when the objective and constraints are linear functions of the decision cells. The production example is linear: each additional unit adds a fixed amount of profit and uses fixed amounts of resources. For linear models, this method is generally the appropriate starting point.
Choose GRG Nonlinear for smooth nonlinear models, where formulas involve relationships such as powers or products of changing cells. Choose Evolutionary for models with discontinuities or relationships that are not smooth, although it may take longer to find a solution. Integer or binary restrictions can also make a model harder to solve. If results look unexpected, check that the selected method suits the formulas and constraints rather than assuming Solver has ignored the worksheet.
Solver’s Options button provides additional controls, including search and precision settings. These are not additional decision variables; they influence how Solver searches for a solution. Leave defaults in place unless you have a reason to adjust them, and change one setting at a time so you can tell whether it affects the result.
Check and preserve the result
When Solver finishes, review the status message and decide whether to keep the solution or restore the original values. Keeping a solution writes the found values into the changing cells. It does not make the model permanently fixed: you can reopen Solver and run it again after changing an input or constraint. The worksheet formulas should then recalculate from the new decision values.
Check the result independently. In the production example, 40 units of A and 20 of B produce 40 × 40 + 20 × 30 = 2,200 in profit. They consume 40 × 2 + 20 × 1 = 100 labor hours and 40 × 1 + 20 × 2 = 80 material units. Verifying the objective and each limit helps catch wrong cell selections, units, or formulas. Solver may also offer reports after a successful solve; available reports depend on the model and method.
If you will reuse a model, keep the assumptions and limits in labeled worksheet cells, save the workbook, and consider saving Solver’s model settings from the Solver dialog. That makes it easier to distinguish a changed input from a changed constraint. Solver’s model settings do not replace the worksheet formulas or the underlying data, so retain both.
Common problems and how to diagnose them
- Solver is missing: enable the Solver Add-in using the Windows steps above. In Excel for Mac, use Tools > Excel Add-ins, select Solver Add-in, and confirm. Ribbon layout can differ by release, but the add-in is accessed from Excel’s desktop application.
- Solver reports no feasible solution: the constraints may conflict. For example, a minimum production requirement might exceed a resource limit. Check each inequality, units, and whether a limit cell contains the value you intend.
- The answer seems wrong: verify the objective formula references the changing cells, and confirm that the changing-cell range includes every decision. Also check that a maximum has not accidentally been set to a minimum, or that a constraint has not used the wrong direction.
- Unexpected decimals or negative values: add integer or binary restrictions when required, and use the non-negative option or an explicit lower-bound constraint if negative decisions are not allowed. Do not impose whole-number rules unless the real decision must be discrete.
- The model will not solve reliably: simplify it, check formulas for errors, and confirm that nonlinear formulas are intentional. Very large or complicated problems may exceed the capabilities of the standard Solver add-in or take substantial time.
Frequently Asked Questions
How do I add a constraint in Excel Solver?
Open Data > Solver, choose Add in the constraints area, then enter a cell reference, a relationship such as <=, =, or >=, and a number or cell reference for the limit. Choose Add again for another rule, or OK when finished.
Can Solver change more than one cell?
Yes. Enter a range or multiple cell references in By Changing Variable Cells. Each changing cell represents a decision Solver can adjust. Make sure the objective and relevant constraint formulas depend on those cells.
What is the difference between a changing cell and a constraint?
A changing cell is a decision Solver is allowed to alter, such as a quantity to produce. A constraint is a rule that the resulting values must obey, such as total hours being no more than the available hours. The objective is the result Solver tries to optimize.
Can I use Solver in Excel for the web?
The classic Solver Add-in is a desktop Excel add-in and is not available to run in Excel for the web. Open the workbook in the desktop application to use it. On Mac, enable the add-in through Tools > Excel Add-ins; on Windows, use File > Options > Add-ins.
Why does Solver return a fractional answer?
Unless the model restricts a decision to whole numbers, Solver can use fractional values when they improve the objective and satisfy the constraints. Add an int constraint for whole numbers or bin for a zero-or-one decision when the real-world problem requires it.
Related
- Excel Slicer Multiple Selections: How to Use Them
- Excel Slicer Formatting: Styles, Colors, and Layout
- Excel Slicer Greyed Out? Causes and Fixes
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Budget Spreadsheet NZ: Build a Practical Excel PlanA useful budget spreadsheet for New Zealand is a simple Excel sheet that compares planned income and spending…
- Customer List Excel Free Template: What to IncludeYes—you can make a free customer list template in Excel by adding a header for each type of…
- Lock Cells in Google Sheets: Protect a RangeTo lock cells in Google Sheets, select the cells, choose Data > Protect sheets and ranges, then set…
- Can You Alphabetize in Google Sheets? Sorting Rows and ColumnsYes. In Google Sheets, select the data you want to organize and use Data > Sort range to…
- Insert an Electronic Signature in WordTo insert an electronic signature in Word, add a picture of your handwritten signature, draw one with the…
- CSV File to Excel Converter: Convert Without Data LossTo convert a CSV file to an Excel workbook in Microsoft Excel for Microsoft 365 on Windows, select…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.