Excel Automatic Goal Seek: Options for Repeated Models

How-to basics · Updated November 3, 2026

Excel Automatic Goal Seek: Options for Repeated Models

Excel Goal Seek does not automatically rerun whenever a worksheet changes: you must start it again, or use a formula, Solver, or a VBA macro to automate the process. To run it manually in Excel for Microsoft 365 on Windows, choose Data > What-If Analysis > Goal Seek, then specify the formula cell, target value, and one input cell Excel may change.

What Goal Seek does—and what it does not do

Goal Seek is a built-in what-if analysis tool for finding an input that makes a formula return a value you specify. You provide three pieces of information: the formula cell to set, the result you want, and one cell Excel is allowed to adjust. Excel tries different values in the changing cell and recalculates dependent formulas until it finds a solution or cannot make sufficient progress.

Despite its name, Goal Seek is not a continuously running optimizer. After it finds a result, it places that result in the changing cell and stops. If you later change another assumption, the output formula recalculates, but Excel does not automatically search for a new input. That distinction is important when a model is used repeatedly: a displayed result may no longer meet the target after its assumptions change.

Goal Seek also has a narrow scope. It changes one cell to reach one numeric target. It does not directly handle several changing inputs, constraints such as minimum or maximum values, or a goal such as maximizing profit. Those jobs call for a different modeling approach or Excel Solver.

Run Goal Seek manually

Start with a worksheet that has a formula depending on the cell you want Excel to change. For example, put a unit price in B2, units sold in B3, and revenue in B4. With price in B2 and quantity in B3, enter this formula in B4:

=B2*B3

Suppose quantity is 25 and you want revenue of 1,000. Select a cell in the worksheet, then open Data > What-If Analysis > Goal Seek. In the dialog, enter:

  • Set cell: B4, the cell containing the revenue formula.
  • To value: 1000, the target result.
  • By changing cell: B2, the price input Excel can adjust.

Choose OK to let Excel calculate, review the result, and choose OK again to keep it or Cancel to restore the starting value. With 25 units, the solution is a price of 40 because 40 multiplied by 25 equals 1,000. The calculation is illustrative; it does not account for discounts, taxes, or other business conditions.

The set cell must contain a formula, and that formula must depend directly or indirectly on the changing cell. The changing cell should be an input value, not another formula that Excel would overwrite. A sensible starting value can help the search, particularly when the model is nonlinear or has multiple possible solutions.

Why the result is not automatic

Ordinary worksheet formulas recalculate when their dependencies change. Goal Seek is different: it is an instruction to search for an input, not a formula stored in a cell. Excel does not preserve the search instruction as part of the calculation chain. Therefore, changing B3 from 25 to 30 would update B4 using the current price, but would not make Excel find a new price that keeps revenue at 1,000.

This behavior can be useful. A search may take time, and some models have several possible solutions or no meaningful solution. Automatically changing an input every time any related cell changes could surprise someone reviewing the workbook. When you need a result that updates predictably, first check whether ordinary algebra or a direct formula can solve the model.

Use a formula when the model allows it

For a simple revenue target, a formula can calculate the required price without Goal Seek. Assume B2 is the price, B3 is units sold, B4 is revenue, and B5 contains the target revenue. If the target is 1,000 and quantity is positive, enter this in B2:

=B5/B3

With B5 equal to 1,000 and B3 equal to 25, the result is 40. In this design, B2 is calculated rather than manually adjusted, so it updates when either the target or quantity changes. Do not also use Goal Seek to change B2: a formula cell cannot serve as the changing input because Goal Seek would replace its formula with a value.

Direct formulas are a good fit when the unknown can be isolated cleanly. More complicated profit, pricing, or loan models may involve several dependent calculations, nonlinear relationships, or functions that make rearranging the equation impractical. In those cases, Goal Seek may be easier for a one-time answer, while Solver or a controlled macro may suit repeated analysis. For financial examples, use illustrative assumptions only and confirm actual terms with the lender or a qualified professional.

Make repeated searches automatic with VBA

If the same search must run whenever a particular input changes, a VBA worksheet event can call Excel’s GoalSeek method. In this example, B3 is the quantity users edit, B2 is the price to solve for, and B4 contains the revenue calculation. With price in B2 and quantity in B3, the formula in B4 is:

=B2*B3

In Excel for Microsoft 365 on Windows, right-click the worksheet tab, choose View Code, and place the following event procedure in that worksheet’s code window. It reruns the search for revenue of 1,000 when B3 changes:

Private Sub Worksheet_Change(ByVal Target As Range)
    On Error GoTo CleanUp

    ' Run only when the quantity input changes.
    If Intersect(Target, Me.Range("B3")) Is Nothing Then Exit Sub

    Application.EnableEvents = False
    Me.Range("B4").GoalSeek Goal:=1000, ChangingCell:=Me.Range("B2")

CleanUp:
    Application.EnableEvents = True
End Sub

Save the workbook as an Excel Macro-Enabled Workbook (.xlsm), and allow macros only when you trust the workbook. Make a copy before running a macro: macro actions cannot be undone with Ctrl+Z. The event procedure is deliberately limited to changes in B3; changing a different assumption will not trigger it unless the code is adjusted. Disabling events during the search prevents changes made by Goal Seek from recursively starting the same event.

This approach is automation, not a universal “automatic Goal Seek” setting. It relies on macros being enabled, and it can overwrite B2 whenever B3 changes. It also needs error handling and clear instructions if other people use the workbook. On a Mac, Excel supports VBA, though the ribbon and code-editor access may differ; keyboard shortcuts also differ from Windows. Excel for the web cannot run VBA macros, so use desktop Excel for this method.

When Solver or other tools are a better fit

Use Solver when the model needs more than one changing cell, needs limits on the values, or needs to maximize or minimize an objective. For example, a production model might maximize profit by changing quantities of several products while respecting labor-hour and material limits. Goal Seek cannot express those multiple decision variables and constraints in one search.

Solver is an Excel add-in. If it is not visible, go to File > Options > Add-ins. In the Manage list, select Excel Add-ins, choose Go, check Solver Add-in, and choose OK. Solver then appears on the Data tab. Solver is more flexible, but it requires you to define the objective, variable cells, and any constraints; it is not simply a background version of Goal Seek.

For repeated preset cases, Scenarios can store alternative input sets, while a data table can show how one or two inputs affect formula results. These are useful for comparing outcomes, but they do not generally search for the one input that reaches a chosen target. Choose the tool based on the question: calculate a direct relationship with a formula, solve one input for one target with Goal Seek, compare cases with what-if tools, or optimize multiple variables with Solver.

Common problems and practical checks

  • Goal Seek is unavailable in the web app: Open the workbook in desktop Excel. The Goal Seek command is a desktop feature, and VBA automation also requires desktop Excel.
  • The set cell is rejected: Confirm that it contains a formula and that the formula depends on the changing cell. A typed number alone is not a valid set cell.
  • The result is unexpected: Check units, signs, formula references, and the starting value. For example, entering 1000 as the target means exactly 1,000, not a displayed value of $1,000 if the underlying units differ.
  • Excel reports no solution: The target may be impossible for the model, or the formula may not respond to the selected input. Check for formulas that ignore the changing cell, hard limits, and discontinuities.
  • The answer changes between runs: A nonlinear formula can have more than one solution. Different starting values may lead Excel toward different results. Test whether the answer makes sense in the model before accepting it.
  • The macro does nothing: Confirm that macros are enabled, the code is in the correct worksheet module, and the edited cell is B3. Also verify that B4 contains a formula and that B2 is an editable numeric input.

Goal Seek is a numerical search, so its displayed result may be approximate rather than an exact symbolic solution. Check the resulting formula value and any required tolerance. If small differences matter, increase displayed precision and assess whether the remaining difference is acceptable for the model.

Frequently Asked Questions

Can Excel Goal Seek run automatically when a cell changes?

Not by itself. Goal Seek runs when you start the command. A direct worksheet formula can update automatically for solvable relationships, or VBA can call GoalSeek after a chosen cell changes.

Where is Goal Seek in Excel for Microsoft 365?

On Windows, look under Data > What-If Analysis > Goal Seek. The exact ribbon grouping can vary with the window layout. In Excel for the web, open the workbook in desktop Excel to use Goal Seek.

Can Goal Seek change more than one cell?

No. Goal Seek changes one input cell to reach one target in a formula cell. Use Solver if you need multiple changing cells or constraints.

Why does Goal Seek change my input cell?

Changing that input is its purpose: Excel searches for a value that makes the set-cell formula reach the target. Choose an input that is safe to change, and keep a copy of the original value if you may need it later.

Does Goal Seek work with a formula as the changing cell?

No. The changing cell is where Excel writes its trial and final values, so it should be an editable input cell rather than a formula cell. Put calculations in dependent formula cells and select the intended input as the changing cell.

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.