In Excel for Microsoft 365 on Windows, use Goal Seek to find the input value that makes a formula return a result you specify: select the formula cell, then choose Data > What-If Analysis > Goal Seek. Enter the target result and the one input cell Excel may change, then select OK.
What Goal Seek does
Goal Seek is a built-in What-If Analysis tool for working backward from a desired result. Instead of asking what a formula returns for a particular input, you tell Excel the result you want and ask it to find an input that produces it. For example, you might know your target profit and want to estimate how many items must be sold, or know the monthly payment you can afford and want to estimate a loan amount under specified assumptions.
The feature changes one cell and recalculates a formula that depends on it. It is useful when the relationship is already represented in a worksheet formula but solving the equation manually would be inconvenient. Goal Seek changes the input value in the worksheet; it does not create a separate forecast, preserve a record of all possible outcomes, or determine whether your assumptions are sensible.
How Goal Seek works
The Goal Seek dialog has three fields. Set cell is the cell containing the formula whose result you want to control. To value is the target result, entered as a number. By changing cell is the input cell Excel is allowed to adjust. The changing cell must be used, directly or through other formulas, in the calculation of the set cell.
For instance, if a profit formula depends on unit sales, Goal Seek can vary the sales input until the formula returns a target profit. It does not rewrite the formula or alter other input cells. Excel repeatedly recalculates the worksheet while adjusting the selected input. Because this is a numerical search, the answer may be an approximation rather than an exact symbolic solution, and a suitable answer depends on the structure of the formula and the starting value.
How to run Goal Seek in Excel
In the Windows desktop version of Excel for Microsoft 365, prepare the formula and input cells first. Then follow these steps:
- Select the worksheet containing the formula you want to reach.
- Choose Data > What-If Analysis > Goal Seek.
- In Set cell, enter or select the cell with the formula.
- In To value, type the desired numeric result. Do not enter a formula in this field.
- In By changing cell, select the input cell Goal Seek is allowed to adjust.
- Select OK to let Excel calculate. Review the proposed result, then select OK in the status dialog to keep it or Cancel to restore the previous value.
Before running it, make sure the set cell displays a calculated result rather than a typed value, and confirm the changing cell is a genuine input rather than another formula cell. It is also sensible to note the original input value: accepting Goal Seek’s result replaces that value in the changing cell.
Worked example: find the sales needed for a profit target
Suppose a small business has fixed costs of $18,000 and earns $12 in contribution per unit after variable costs. The objective is to find the number of units that produces $6,000 in profit. This is an illustrative spreadsheet example, not financial or business advice.
- Enter fixed costs of 18000 in B2.
- Enter contribution per unit of 12 in B3.
- Enter a starting estimate, such as 1000, in B5.
- Use B6 for the profit formula. With fixed costs in B2, contribution per unit in B3, and the unit estimate in B5, enter
=B5*B3-B2in B6.
Now open Goal Seek and set B6 to 6000 by changing B5. The result is 2,000 units: 2,000 multiplied by $12 is $24,000, and $24,000 minus $18,000 equals the $6,000 target. If the desired result represents whole products, check that the answer is a whole number. In this example it is; in other cases Goal Seek can return a fractional value, which may need a separate rounding or business-rule decision.
This example also illustrates why formulas matter. If B6 contains a fixed number instead of a formula based on B5, Goal Seek has no calculation to work backward through. Likewise, changing a cell that is not connected to B6 will not help Excel reach the target.
When Goal Seek is a good fit
Use Goal Seek when a single result is known, one input is unknown, and the worksheet already calculates the result from that input. It is especially handy for a quick sensitivity question such as how many sales are needed for a chosen revenue target, what score is needed on a final exam to reach a course average, or what value of a model assumption produces a specified output.
For a weighted grade example, a formula might combine completed-work points with a final-exam score. Goal Seek can solve for the score needed to reach a target average if the score is the only variable being changed. Before relying on the answer, verify that the result is possible: an answer above the exam’s maximum score signals that the target cannot be met under the entered assumptions.
Goal Seek is not a general-purpose optimizer. It does not automatically choose among many changing cells, enforce conditions such as nonnegative quantities, or compare every possible outcome. A result also says nothing about whether the assumptions or target are realistic; it answers only the mathematical question represented by the worksheet.
Limits and common problems
The main limitation is that Goal Seek changes only one input cell at a time. If a target depends on price, volume, and costs and you want Excel to adjust several of them together, Goal Seek is not the right tool. It also does not impose constraints such as whole numbers, upper and lower bounds, or resource limits.
Another issue is that some formulas do not have a useful answer for every starting value. A division-by-zero error, an invalid date calculation, a discontinuous formula, or a formula with several possible roots can make the search fail or converge on an unexpected result. If more than one input could produce the target, Goal Seek generally returns one result based on its numerical search; it does not promise to find all possible answers.
If Excel reports that it cannot find a solution, or the result looks wrong, check the following:
- Confirm that the set cell contains the intended formula and currently recalculates without an error.
- Check that the changing cell is referenced by the set-cell formula, directly or through dependent formulas.
- Verify the target’s units and scale. For example, entering 6000 is different from entering 6.
- Try a more sensible initial value in the changing cell, especially when formulas behave differently across ranges.
- Inspect formulas for rounding, IF conditions, lookup breaks, or other jumps that can prevent a smooth numerical search.
- After a result is found, recalculate or substitute it into the model and confirm that the displayed output is close enough to the target for your purpose.
Do not treat a successful message as proof that the model is correct. A formula can contain an incorrect reference and still produce a result. Check the worksheet logic and the output independently.
Goal Seek compared with other What-If tools
Excel’s What-If Analysis group includes tools for different kinds of questions. A one-variable data table shows how one or more formulas respond to a range of values for one input. A two-variable data table examines combinations of values for two inputs. These tables are useful when you want to compare many outcomes, while Goal Seek works backward to find one input for one target.
Scenario Manager stores named sets of input values so you can compare scenarios such as optimistic, expected, and cautious assumptions. It is useful for switching among cases, but it does not search for the input that reaches a target. Solver is the more appropriate choice when an objective depends on multiple changing cells or must obey constraints. Solver is a separate Excel add-in; it supports optimization problems that Goal Seek cannot express. For a simple one-input target, Goal Seek is usually the more direct option.
Windows, Mac, and Excel for the web
The steps above apply to Excel for Microsoft 365 on Windows. Excel for Microsoft 365 for Mac also provides Goal Seek in the Data tab’s What-If Analysis tools, although the ribbon layout can look different from Windows. If you cannot see the command, check the Data tab and the available What-If Analysis menu for your installed desktop version.
Excel for the web does not provide the desktop Goal Seek command in the same way. If the workbook needs Goal Seek, open it in the Excel desktop app, run the analysis there, and save the workbook. The resulting input and formulas can then be viewed in the browser, but do not assume the web app can repeat every desktop what-if operation.
Frequently Asked Questions
Is Goal Seek the same as What-If Analysis?
Goal Seek is one tool within Excel’s What-If Analysis features. The group also includes tools such as data tables and Scenario Manager, which answer different kinds of questions.
Can Goal Seek change more than one cell?
No. Goal Seek changes one input cell for each run. Use Solver when you need multiple changing cells or constraints, or run Goal Seek repeatedly if separate one-variable questions are appropriate.
Why is Goal Seek greyed out or unavailable?
Check that you are using the desktop Excel app and have a worksheet selected. The command may not be available in Excel for the web, and ribbon placement can differ by platform. Also confirm you are looking under the Data tab’s What-If Analysis tools.
Can Goal Seek return a decimal when I need a whole number?
Yes. Goal Seek solves for a numeric input and does not enforce an integer constraint. For units, people, or other countable quantities, decide how to handle a fractional result and then recalculate the formula using the whole-number input you intend to use.
Does Goal Seek change my formula?
No. It changes the value in the selected changing cell and recalculates dependent formulas. You can keep or reject the proposed value in the result dialog; keeping it overwrites the prior input in that cell.
Why does Goal Seek find an answer that seems unreasonable?
It may be a mathematically valid result for the worksheet formula but still violate real-world limits or depend on incorrect assumptions. Check the formula, units, possible alternative solutions, and whether the returned input is allowed in your situation.
Related
- Excel Slicers: Advanced Features and Smart Tips
- Excel Slicer Examples: PivotTables, Tables, and Tips
- Excel Slicer Formatting: Styles, Size, Layout, and Use
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- How to Find a Middle Name in Excel: Formula and StepsWith full names in A2 and names written in first-middle-last order, enter =IFERROR(INDEX(TEXTSPLIT(TRIM(A2)," "),1,2),"") in B2 to return…
- COUNTIF Examples: Formulas for Common Spreadsheet TasksUse Excel’s COUNTIF function to count cells in one range that meet one condition: =COUNTIF(range,criteria). For example, it…
- Excel Formula for Tracking Hours in a Daily TimesheetFor a basic Excel timesheet, put a start time in B2 and an end time in C2, then…
- Excel Sort and Filter Shortcuts: A Practical GuideIn Excel for Microsoft 365 on Windows, press Ctrl+Shift+L to turn filter buttons on or off for a…
- Nested XLOOKUP Examples for ExcelA nested XLOOKUP places one XLOOKUP inside another, so one search can supply the lookup value, return array,…
- COUNTIF Excel: How to Reference Cells in CriteriaTo make COUNTIF use a cell as its criterion, put the cell reference in the second argument: with…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.