Can You Goal Seek Multiple Cells at Once in Excel?

How-to basics · Updated November 3, 2026

Yes—but Excel’s built-in Goal Seek can change only one input cell to reach a target in one formula cell per run. To solve several targets, run Goal Seek repeatedly, automate the runs with VBA, or use Solver when your model needs multiple adjustable inputs at the same time.

What “multiple cells” means in Goal Seek

The question can refer to two different tasks: changing several input cells to reach one result, or reaching several results in different formula cells. Goal Seek handles neither as a simultaneous multi-cell operation. Each run has one formula cell whose value you want to set, and one changing cell that Excel adjusts.

That distinction matters because multiple runs can still be a good solution when each target has its own independent input. For example, you could use Goal Seek once to find the price needed for Product A and again to find the price needed for Product B. But if one result depends on two inputs that must both change, or if you need multiple outcomes to hold together, Solver is usually a better fit.

How Goal Seek works in Excel

Goal Seek works backward from a desired result. You provide a formula cell, a target value, and an input cell that the formula depends on. Excel then changes the input numerically and recalculates the formula until the result is close to the target. It does not rewrite the formula or create a separate solution model.

In Excel for Microsoft 365 on Windows, open Data > What-If Analysis > Goal Seek. Enter the formula cell in Set cell, the desired result in To value, and the input to adjust in By changing cell. Select OK, review the result, and accept it if it is suitable. Goal Seek is also available in desktop Excel for Mac; the ribbon labels can vary slightly by release. Excel for the web does not provide the desktop Goal Seek command, so open the workbook in the desktop app to use it.

For a simple example, suppose B2 contains a unit price, B3 contains a quantity of 40, and B4 is the revenue result. With that layout, enter this formula in B4:

=B2*B3

To find the price that produces revenue of 1,000, set cell B4 to 1000 by changing B2. The result is a price of 25, because 25 multiplied by 40 equals 1,000. Goal Seek changes B2; it does not change both B2 and B3. If B3 were also an input you needed to optimize, this would be a multi-variable problem.

Run Goal Seek for several independent targets

If each result has a separate input, repeat the operation for each model. For instance, imagine a worksheet with one row per product: quantity in column A, adjustable price in column C, revenue formula in column D, and target revenue in column E. Each row can be solved separately, provided its revenue formula depends on that row’s price and the rows do not interfere with one another.

With quantities in A2:A10 and prices in C2:C10, put this formula in D2 and copy it down through D10:

=A2*C2

For row 2, set D2 to the target in E2 by changing C2. Repeat for rows 3 through 10, using each row’s formula cell, target, and price cell. If A2 is 40 and E2 is 1000, Goal Seek sets C2 to 25. This approach is straightforward for a small number of scenarios and keeps each result visible in the worksheet.

Before repeating the process, check whether changing one row can affect another. If every row has its own independent inputs and formulas, solving one should not disturb the others. If several formula cells refer to the same shared input, however, changing that input for a later target can invalidate an earlier result. In that case, consider separate copies of the model, a Solver model, or an automated setup designed around the shared relationships.

Automate repeated runs with a VBA macro

For dozens or hundreds of independent rows, a macro can call Goal Seek once per row. In the example below, column A contains quantity, column C contains the price to adjust, column D contains the revenue formula, column E contains the target revenue, and column F receives a status. Each D-cell formula must depend on the matching C-cell. The macro finds the last used row in column D and attempts one Goal Seek operation for each row.

In Excel for Windows, press Alt+F11 to open the Visual Basic Editor, insert a standard module, and paste the code. The Mac shortcut differs; use the Visual Basic Editor command available from Excel’s Developer tab or Tools menu. Save a copy of the workbook before running the macro: macro changes cannot be undone with Ctrl+Z (or Command+Z on Mac).

Sub GoalSeekEachRow()
    Dim ws As Worksheet
    Dim lastRow As Long
    Dim r As Long
    Dim solved As Boolean

    ' Use the worksheet that holds the scenario table.
    Set ws = ThisWorkbook.Worksheets("Models")
    lastRow = ws.Cells(ws.Rows.Count, "D").End(xlUp).Row

    ' Solve each row's result by changing that row's input.
    For r = 2 To lastRow
        solved = ws.Cells(r, "D").GoalSeek( _
            Goal:=ws.Cells(r, "E").Value, _
            ChangingCell:=ws.Cells(r, "C"))

        If solved Then
            ws.Cells(r, "F").Value = "Solved"
        Else
            ws.Cells(r, "F").Value = "No solution found"
        End If
    Next r
End Sub

Name the worksheet Models or change that name in the code to match your tab. Check that every target in column E is numeric and that the formula cells in column D contain formulas, not typed results. The macro reports whether Goal Seek found a solution, but that status is not a substitute for checking the resulting values and confirming that the model behaves as intended.

A row-by-row macro is not the same as solving all the equations together. It is appropriate when each row is an independent case. If formulas share changing cells, or if solving a later row can change the conditions for an earlier one, the macro may produce results that do not satisfy all targets at once.

When Solver is the better choice

Use Solver when one objective depends on multiple changing cells, or when you need to impose constraints. For example, you might need to choose quantities of three products to reach a profit target while keeping total production within capacity and each quantity nonnegative. Goal Seek cannot adjust all three quantities together or enforce those conditions.

Solver is an Excel add-in. In Windows desktop Excel, enable it through File > Options > Add-ins. At the bottom, select Excel Add-ins beside Manage, choose Go, and check Solver Add-in. After it is enabled, open Data > Solver. Set the objective cell, choose the objective value or optimization direction, identify the changing variable cells, and add any necessary constraints. Excel for Mac also supports Solver as an add-in, though its add-in management path differs by release.

Solver is more flexible, but it is not simply a multi-cell version of Goal Seek. It optimizes an objective subject to constraints; the chosen method and starting values can matter, particularly with nonlinear models. If the actual requirement is to make several separate formula cells equal several separate targets, you may need to express those requirements as constraints or restructure the model. For a simple set of independent one-input targets, repeated Goal Seek runs are often easier to understand.

Limits and common problems

Goal Seek is a numerical search, not a guarantee that every equation has a usable solution. It can fail to converge, return an impractical input, or find one of several possible solutions. Review the result rather than assuming that a completed dialog means the answer is unique or appropriate.

  • The selected formula cell is not a formula. Set cell should contain a formula that changes when the selected input changes. A typed value cannot respond to Goal Seek.
  • The changing cell does not affect the result. Check that the formula refers directly or indirectly to the input. If changing it leaves the result unchanged, Goal Seek has no path to the target.
  • The target is unreachable. A formula may have a limited range of possible outputs. For example, a percentage capped at 100% cannot produce a result above that limit through changes to an unrelated input.
  • There are several possible answers. A nonlinear formula can cross the target more than once. The result can depend on the starting value, so try a sensible starting point and validate the final answer.
  • The result is close but not exact. Goal Seek uses numerical iteration and may return a value that is near the target rather than mathematically exact. Check the displayed result at adequate precision and consider whether rounding or model assumptions explain the difference.
  • One run disrupts another. If multiple targets share an input, changing that input for a later Goal Seek can change earlier outputs. Separate the scenarios or solve the linked model as a whole.

Also check for circular references and calculation settings if a worksheet does not update as expected. A formula that depends on the changing cell only through a circular calculation may require iterative calculation settings, and ordinary Goal Seek is not a replacement for designing a stable model. Keep a record of the original input values if you need to compare or restore them.

Choosing the right approach

The best method depends on how the targets and inputs relate. A quick decision guide is:

  • One target and one input: Use Goal Seek directly.
  • Several targets with independent inputs: Repeat Goal Seek manually for a few cases, or use a row-by-row macro for a larger table.
  • One target with two or more adjustable inputs: Use Solver if the model needs to choose among those inputs.
  • Several linked targets that must hold simultaneously: Build a combined model and use Solver or another suitable optimization method; independent runs may conflict.
  • Many repeated what-if cases with fixed input combinations: Consider a data table or a structured scenario layout instead of solving each case backward.

Data tables and Scenario Manager are useful for comparing predefined assumptions, but they do not make Goal Seek handle multiple changing cells. A data table calculates outputs for selected input values; it does not search for an input that reaches a target. Scenario Manager stores sets of values for comparison rather than solving equations. These tools answer related but different questions.

Frequently Asked Questions

Can Goal Seek change two cells at once?
No. A Goal Seek run has one changing cell. If two or more inputs must be adjusted to reach a result, use Solver or reformulate the problem so only one input needs to vary.

Can I Goal Seek several formula cells at the same time?
Not with the built-in Goal Seek dialog. Run it separately for each formula cell if the targets are independent. If all targets must be satisfied together and share inputs, model the relationships together and consider Solver.

Can I use Goal Seek on multiple rows in Excel?
Yes, but not as a single built-in command across rows. Run Goal Seek once per row, or use a VBA macro when each row has its own formula, target, and changing cell.

Does Goal Seek work in Excel for the web?
The desktop Goal Seek command is not available in Excel for the web. Open the workbook in desktop Excel for Windows or Mac to use Goal Seek; VBA macros also require desktop Excel.

What is the difference between Goal Seek and Solver?
Goal Seek changes one input to make one formula reach a specified value. Solver can work with multiple changing cells and constraints to optimize an objective, making it more suitable for linked or multi-variable models.

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.