Excel Goal Seek With Multiple Variables: When to Use Solver

How-to basics · Updated November 19, 2026

No: Excel’s Goal Seek changes only one input cell to make a formula reach a target. To adjust multiple input cells together, use Solver: set the objective formula, choose the changing cells, and add any limits the model must obey.

What Goal Seek can—and cannot—do

Goal Seek is a useful one-variable what-if tool. You provide three things: the formula cell whose result matters, the result you want, and one input cell Excel may change. Excel then searches for an input value that makes the formula equal the target. In Microsoft 365 for Windows, open Data > What-If Analysis > Goal Seek. The dialog is also available in desktop Excel for Mac, although its placement can vary between releases.

The key restriction is that the “By changing cell” box accepts one cell, not a range. If your formula depends on several assumptions—such as price, quantity, and a discount—Goal Seek cannot vary all of them simultaneously. Running Goal Seek repeatedly does not solve that limitation: each run changes one selected input while the other inputs remain fixed, and the order of those runs can affect the result.

This does not mean Goal Seek is limited to formulas with one precedent. Its target formula can depend on many cells, including cells calculated from other formulas. The limitation is how many input cells Goal Seek is allowed to alter, not how many cells contribute to the result.

Use Solver to change multiple cells

Solver is Excel’s optimization add-in. It can change multiple decision cells at once to maximize or minimize a formula, or make that formula equal a specified value. You can also add constraints, such as a capacity limit, a minimum quantity, or a requirement that values be whole numbers. That makes Solver the usual choice when a problem has several adjustable inputs or needs rules enforced while searching.

In Excel for Microsoft 365 on Windows, enable Solver if it is not already available:

  1. Select File > Options > Add-ins.
  2. At the bottom, set Manage to Excel Add-ins and select Go.
  3. Check Solver Add-in, select OK, and allow Excel to install or enable it if prompted.
  4. Look for Solver on the Data tab, usually in the Analysis group.

On a Mac, use Tools > Excel Add-ins, select Solver Add-in, and then look for Solver on the Data tab. Solver is a desktop feature; Excel for the web does not provide the desktop Solver add-in, so open the workbook in the Excel desktop app to run it.

To configure a model, select Data > Solver. Set the objective to the cell containing the formula you want to optimize. Choose Max, Min, or Value Of, depending on the goal. In By Changing Variable Cells, select every input Solver may adjust. Use Add to enter constraints, choose an appropriate solving method, and select Solve. Review the result before accepting it; Solver can offer to keep the solution or restore the original values.

A worked example with two variables

Suppose a workshop makes products X and Y. Each unit of X earns 40 contribution points and uses two hours of machine time and one unit of material. Each unit of Y earns 30 points and uses one machine hour and two material units. The workshop has 400 machine hours and 500 material units available. The question is how many units of each product to make to maximize total points.

Put the number of X units in B2 and the number of Y units in C2. With those decision cells in B2 and C2 and the total score in B4, enter this objective formula in B4:

=40*B2+30*C2

With B2 holding X units and C2 holding Y units, calculate machine hours in D2 with:

=2*B2+C2

With the same decision cells, calculate material use in D3 with:

=B2+2*C2

Open Solver and set the objective to B4, select Max, and set By Changing Variable Cells to B2:C2. Add D2 <= 400 and D3 <= 500 as constraints. Also require B2:C2 to be nonnegative; add an integer constraint if fractional units are impossible in the real process. Since every relationship in this example is linear, choose Simplex LP.

One optimum is 100 units of X and 200 of Y. That uses 2 × 100 + 200 = 400 machine hours and 100 + 2 × 200 = 500 material units. The objective is 40 × 100 + 30 × 200 = 10,000 points. The result is not a guess produced by Goal Seek: Solver searches the two changing cells together while respecting both resource limits.

Choose the solving method that fits the model

Solver’s method matters because the shape of the formulas determines how it searches. In the Solver Parameters dialog, select the method that matches the model:

  • Simplex LP: Use it when the objective and constraints are linear, as in the production example. A linear expression has variables that are not multiplied by each other or used in nonlinear operations.
  • GRG Nonlinear: Use it for many smooth nonlinear models, such as formulas involving powers or curved relationships. Results can depend on starting values, so a solution may be a local optimum rather than the best possible answer across every feasible value.
  • Evolutionary: Consider it for discontinuous or non-smooth models that are difficult for the other methods. It can take longer and may need more careful settings; results should be checked against the model and constraints.

If you are unsure whether a model is linear, inspect both the objective and every constraint. A nonlinear constraint can make the overall problem nonlinear even when the objective looks linear. Integer or binary restrictions can also make a problem harder to solve, so keep the model as simple as the real situation allows.

How to decide between Goal Seek and Solver

Use Goal Seek when there is one input to adjust and a single formula target. For example, if a formula calculates the number of items needed to reach a target score and only the item count may change, Goal Seek is direct and quick. Use Solver when two or more cells must change together, when you need to maximize or minimize a result, or when the answer must respect limits.

A practical distinction is that Goal Seek answers, “What value of this one input makes the formula equal this number?” Solver can answer, “What combination of these inputs produces the best result while satisfying these rules?” If you only want to compare results for a few manually chosen combinations, you may not need either tool; a small table of formulas may be clearer.

Solver does not automatically know what counts as a sensible answer. If a quantity cannot be negative, add a nonnegative constraint. If a choice must be a whole number, add an integer constraint. If there are several equally good combinations, Solver may return one of them, not a uniquely meaningful choice. Add the business rules that distinguish acceptable outcomes before interpreting the result.

Common problems and ways to troubleshoot them

  • Solver is missing: Confirm the Solver Add-in is enabled in Excel Add-ins. If you are using Excel in a browser, open the file in desktop Excel instead.
  • The result violates expectations: Check that the objective cell contains a formula linked to the changing cells, and that constraints refer to the correct calculated cells. A typed constant in the objective will not respond to changing inputs.
  • It returns an implausible value: Add missing bounds, nonnegativity rules, or integer requirements. Solver will otherwise consider values the real problem may not allow.
  • It cannot find a solution: The constraints may conflict, the target may be unreachable, or starting values may be poor for a nonlinear model. Test the constraints individually and verify the formulas before changing solver settings.
  • Results change between runs: Nonlinear models can have multiple local optima. Try reasonable alternative starting values and compare the feasible results; do not assume the first result is globally best.

Keep a copy of the original inputs before solving, particularly if the workbook is important. Solver changes the values in the selected variable cells when it applies a solution. Also inspect the final worksheet, since a successful solver status does not confirm that the model itself represents the real-world question correctly.

Alternatives for exploring several inputs

Solver is not the only way to examine more than one input. If the goal is comparison rather than optimization, Excel’s What-If Analysis tools may be more suitable. A two-variable data table can show how one formula changes across combinations of two selected inputs. It evaluates a grid of specified values; it does not search for an optimum or enforce resource constraints.

Scenario Manager can store and compare sets of input values, such as a low, expected, and high case. It is useful when you already have scenarios in mind, but it does not calculate the best combination. For larger models, a separate optimization tool or a purpose-built model may be appropriate. Choose based on the question: search for a best feasible answer with Solver, calculate a one-input target with Goal Seek, or compare predefined cases with tables or scenarios.

Frequently Asked Questions

Can Goal Seek change two cells at once?
No. Goal Seek accepts one changing cell. Use Solver when multiple input cells must be adjusted together.

Where is Solver in Excel?
After enabling the Solver Add-in in desktop Excel, find Solver on the Data tab. On Windows, enable it through File > Options > Add-ins; on Mac, use Tools > Excel Add-ins.

Can Solver make a formula equal a target?
Yes. In Solver Parameters, select Value Of and enter the target, then set the changing cells and any constraints. Use Goal Seek instead if only one input cell is allowed to change.

Why does Solver give a different answer from Goal Seek?
They solve different kinds of setups: Goal Seek changes one cell, while Solver can change several and can apply constraints. Nonlinear Solver results can also depend on starting values or on which local optimum it finds.

Can I use Solver in Excel for the web?
The desktop Solver add-in is not available in Excel for the web. Open the workbook in desktop Excel for Windows or Mac to use Solver.

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.