Goal Seek for Multiple Cells in Excel: What You Can Do

How-to basics · Updated November 6, 2026

Goal Seek for Multiple Cells in Excel: What You Can Do

Excel’s Goal Seek can change only one input cell in a single run, so it cannot directly adjust several changing cells to meet several targets at once. For multiple inputs, use Solver; for repeated one-input calculations, run Goal Seek separately or automate those runs.

What Goal Seek can and cannot change

Goal Seek is a What-If Analysis tool for working backward from a result. You give it a formula cell, a value you want that formula to return, and one input cell that Excel is allowed to change. Excel then tries different values in that input until the formula reaches the requested result closely enough.

The phrase “multiple cells” can mean a few different things, and the distinction matters:

  • Several changing cells: Goal Seek cannot adjust multiple inputs in one run. Use Solver if a result depends on several decision variables.
  • Several formula or output cells: Goal Seek works on one target formula cell at a time. It does not make a group of outputs hit separate targets together.
  • Several independent cases: You can run Goal Seek repeatedly, changing the target or model setup for each case, and record the results.

There is also a mathematical limitation: even a tool that can change several inputs cannot always satisfy every requested target. The model may not have a solution, may have many possible solutions, or may require inputs outside realistic limits.

How to run Goal Seek for one cell

In Excel for Microsoft 365 on Windows, set up a formula that depends on the input you want Excel to adjust. Then select Data > What-If Analysis > Goal Seek. In the dialog, fill in these three fields:

  1. Set cell: the cell containing the formula whose result you want to control. It must be a formula cell.
  2. To value: the desired result, entered as a number. For example, enter 1000 to seek a result of 1,000.
  3. By changing cell: the single input cell Excel may vary. It must affect the formula in the Set cell, directly or through other formulas.

Select OK to let Excel calculate a solution. If it finds one, the Goal Seek Status dialog reports whether it found a solution, and the worksheet displays the new input and result. Choose OK to keep the values or Cancel to restore the previous values. Goal Seek changes the workbook’s cell value; it does not create a permanent record of the old input.

On Excel for Mac, Goal Seek is also available through the Data tab’s What-If Analysis tools, though ribbon layout can vary by release. If you are using Excel for the web and cannot find the command, open the workbook in the desktop app to use the desktop What-If Analysis tools.

Worked example: reaching a profit target

Suppose a simple model calculates profit from units sold, selling price, and cost per unit. With units in B2, selling price per unit in B3, cost per unit in B4, and profit in B5, enter this formula in B5:

=B2*(B3-B4)

Assume B2 contains 80, B3 contains 25, and B4 contains 15. Profit is 80 multiplied by the 10 difference between price and cost, or 800. To find how many units would produce 1,000 in profit, open Goal Seek and set the cell to B5, the value to 1000, and the changing cell to B2. The model returns 100 units: 100 multiplied by 10 equals 1,000.

This is a one-input problem because price and cost stay fixed while units change. If you also want Excel to adjust the selling price, Goal Seek cannot change both B2 and B3 in the same run. You would need Solver, or you would need to decide which one input to hold fixed and run Goal Seek with the other.

When several inputs need to change: use Solver

Excel’s Solver add-in is the usual next step when a formula depends on multiple changing cells. Solver can vary a range of decision cells while optimizing one objective cell, and it can apply constraints such as minimums, maximums, whole-number requirements, or relationships between cells. That makes it better suited than Goal Seek to models with several adjustable inputs.

For example, a production plan might need to choose quantities of several products. A formula can calculate total profit, while constraints represent available labor or materials. Solver can search for quantities that maximize profit without exceeding those limits. Goal Seek, by contrast, would only adjust one chosen input to make one formula reach one specified value.

To use Solver on Windows, first check whether the add-in is enabled: choose File > Options > Add-ins, select Excel Add-ins in the Manage box, choose Go, and check Solver Add-in. After enabling it, look for Data > Solver. In Solver, specify the objective cell, whether to maximize, minimize, or reach a value, the changing variable cells, and any constraints. Solver is also available in desktop Excel for Mac, although the add-in settings and dialog layout may differ.

Solver still has one objective cell at a time. If you have several outputs that must each match separate targets, you can add equality constraints for those outputs, if the model and Solver setup permit it. Alternatively, define a single objective that measures the combined mismatch and ask Solver to minimize it. That approach can find a useful compromise when exact matches are impossible, but the choice of how to measure mismatch affects the result. Check the final outputs and constraints rather than assuming the first Solver result is automatically suitable.

Several targets with one changing input

If you have one adjustable input and several outputs, first ask whether one input can logically satisfy all the targets. For example, a single discount rate might affect revenue, margin, and total orders. Goal Seek can make one of those formula cells reach its target, but that does not guarantee the other two will also match their targets. They are consequences of the same input, not additional goals Goal Seek can solve at the same time.

If all the outputs must meet exact requirements, compare the relationships in the model. A single input may have only one value that satisfies the first target, and that value may miss the others. Solver can help test multiple requirements when there are enough adjustable cells and the conditions can be expressed as constraints. If there is no feasible combination, the model or the requested targets may need to change.

A common workaround is to combine several desired results into one score and Goal Seek that score. This only makes sense if the combined score represents what you actually care about. For instance, adding two raw errors with different units can give one output disproportionate influence. A combined score is not the same as independently meeting each target, so document the method and inspect each result separately.

Repeated runs, scenarios, and Data Tables

When you need the same kind of answer for many cases, you can run Goal Seek once per case and save each input and result in a separate table. For instance, you might change a target profit, run Goal Seek, and record the required units before moving to the next target. This is still a sequence of individual solutions, not one multi-cell Goal Seek operation. Make sure the model is reset consistently between runs so a previous solution does not unintentionally become the starting point for the next one.

A one-variable Data Table may be more convenient when you want to see how a formula’s result changes across a list of input values. In desktop Excel, Data Tables are under Data > What-If Analysis > Data Table. A Data Table evaluates specified scenarios; it does not search for an input that makes a formula equal a target. It is useful for comparing outcomes, while Goal Seek is useful for finding an input associated with a chosen outcome.

Scenario Manager is another option when you want to save and compare named sets of inputs. It is designed to store scenarios, not to solve for a target. Choose among these tools based on the job: solving for one input, comparing many trial values, or preserving alternative sets of assumptions are different tasks.

Automating repeated Goal Seek runs

For a small number of cases, using the Goal Seek dialog repeatedly is often the clearest approach. If the same operation must run many times, VBA can call Excel’s GoalSeek method. A macro can repeat the call for different target values or model rows, but the workbook needs a reliable layout and the macro must handle unsuccessful runs. Automation does not remove the one-changing-cell limit of each Goal Seek call.

For example, assuming the worksheet is named Model, B5 contains the formula, and B2 is the input, this macro makes one call to seek profit of 1,000:

Sub SeekProfitTarget()
    Dim ws As Worksheet
    Dim success As Boolean

    ' Use the worksheet that contains the model.
    Set ws = ThisWorkbook.Worksheets("Model")

    ' Change B2 so the formula in B5 seeks a value of 1000.
    success = ws.Range("B5").GoalSeek( _
        Goal:=1000, ChangingCell:=ws.Range("B2"))

    If Not success Then
        MsgBox "Goal Seek did not find a solution."
    End If
End Sub

To run VBA, save the file in a macro-enabled format and allow macros only when you trust the workbook and its source. Save a copy of the workbook before running a macro: macro changes cannot be undone with Ctrl+Z. The example above makes one call; adapting it to many cases requires deliberate handling of the target list, input values, results, and failures.

Common problems and how to troubleshoot them

  • The Set cell is not a formula. Goal Seek needs a formula result to evaluate. Put the calculation in a formula cell and select that cell.
  • The changing cell does not affect the result. Check that the formula in the Set cell depends on the selected input, perhaps through intermediate formulas. If changing the input cannot alter the result, there is nothing for Goal Seek to solve.
  • The requested target is unreachable. A model may have limits, such as a percentage that cannot exceed 100%, or a formula that never produces the requested value. Try a plausible target and inspect the formulas and input bounds.
  • The answer is not a whole number or valid business value. Goal Seek is not a constraint-based optimizer. If units must be integers, or an input must remain within a range, check the result and use Solver when those requirements need to be enforced during the search.
  • The result changes when you run it again. Goal Seek uses an iterative numerical search, and the starting values and model shape can affect the solution it approaches. Review whether the model has multiple possible solutions and whether the displayed result is close enough for your purpose.

Before accepting any result, verify that the input is sensible, the target cell is correct, and the recalculated output is sufficiently close to the target. If the workbook uses rounded formulas, discontinuities, or lookup logic, the relationship may not behave like a smooth calculation; that can make a target harder to reach reliably.

Choosing the right Excel tool

Use Goal Seek when one formula must reach one value by changing one input. Use Solver when several inputs can change, or when constraints are central to the problem. Use a Data Table to compare formula results across selected inputs, and Scenario Manager to save and review named assumption sets. For many repeated target searches, VBA can reduce manual repetition, but each call still solves a one-input Goal Seek problem.

The key question is not simply how many cells are visible in the worksheet. It is how many cells must be treated as decision variables, how many conditions must be satisfied, and whether a solution is mathematically possible. Describing those clearly before choosing a tool prevents a common mistake: expecting Goal Seek to optimize a whole model when it is designed to reverse one formula at a time.

Frequently Asked Questions

Can Excel Goal Seek change multiple cells at once?
No. Each Goal Seek run changes one input cell. Use Solver when you need Excel to adjust multiple changing cells.

Can Goal Seek make multiple formula cells hit different targets?
No. Goal Seek accepts one Set cell and one target value per run. Solver may handle multiple target conditions if you can express them as constraints and the model has a feasible solution.

Where is Goal Seek in Excel for Microsoft 365?
In desktop Excel for Windows, choose Data > What-If Analysis > Goal Seek. In Excel for Mac, look on the Data tab for the What-If Analysis tools; the layout can vary by release.

Why is Goal Seek not finding a solution?
The target may be unreachable, the changing cell may not affect the formula, or the model may be difficult for the iterative search. Confirm the cell references, test a plausible target, and consider Solver if you need constraints or multiple changing cells.

Is a Data Table the same as Goal Seek?
No. A Data Table calculates outputs for input values you specify. Goal Seek searches for an input value that makes one formula reach a specified target.

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.