Excel’s Goal Seek can change only one input cell, so it cannot directly find values for two variables at once. To adjust two cells toward a target, use Solver; to compare the result across pairs of inputs, use a two-variable Data Table instead.
Why Goal Seek handles only one variable
Goal Seek is a tool for answering a focused question: what value must one input have for a formula to return a result you specify? You provide a formula cell, a target value, and one changing cell. Excel then adjusts that cell until the formula is close to the target. It is useful for questions such as how many items must be sold to reach a revenue target, or what dimension produces a chosen area when the other dimension is fixed.
The limitation is built into the Goal Seek setup: its By changing cell field accepts one cell, not a range of independent inputs. Typing a range such as B2:B3 does not turn Goal Seek into a two-variable solver. If you need Excel to choose both values, use Solver. If you want to see what the formula returns for many pairs of values, use a two-variable Data Table.
Choose Solver or a Data Table
These tools address related but different tasks. Solver searches for input values that satisfy a target or optimize an outcome. A Data Table calculates the outcome for a grid of values you specify. Neither is simply a hidden two-cell version of Goal Seek.
- Use Solver when Excel should search for two or more inputs that make a formula reach a target, or maximize or minimize a result. You can also add limits, such as requiring both inputs to be positive.
- Use a two-variable Data Table when you want to compare the formula’s result at many combinations, such as several possible lengths paired with several possible widths. You choose the tested values; Excel fills in the results.
- Use Goal Seek when one input is unknown and the other inputs are already set. It is the simplest option for a single changing cell.
A Data Table does not automatically identify which pair meets a target, although you can inspect its results or use other spreadsheet tools to locate a suitable combination. Conversely, Solver generally returns a solution rather than a full grid showing every alternative.
Example: use Solver to find two dimensions
Suppose a rectangle must have an area of 120 square units, and both its length and width are unknown. Put a trial length in B2 and a trial width in B3. With length in B2 and width in B3, enter this formula in B4 to calculate the area: =B2*B3. Set Solver’s objective cell to B4 and its target value to 120, then tell it to change B2:B3.
One possible answer is a length of 10 and a width of 12, because 10 × 12 = 120. But there are many other answers: 8 and 15 also give 120, as do 6 and 20. With only the area target, the problem does not have one unique solution. Solver may return a different valid pair depending on the starting values, its solving method, and any constraints you add.
This matters in practical models. If you have two unknowns but only one target equation, there may be many valid combinations. Add meaningful requirements if you need to narrow the result—for example, a maximum width, a minimum length, or another relationship that the inputs must satisfy. Do not add arbitrary limits just to force a preferred answer; constraints should represent real requirements.
Set up Solver in Excel for Windows
Solver is an Excel add-in. In Microsoft 365 for Windows, enable it if the Solver command is not visible:
- Select File > Options > Add-ins.
- At the bottom, beside Manage, choose Excel Add-ins, then select Go.
- Check Solver Add-in and select OK. Solver should then appear on the Data tab.
For the rectangle example, select Data > Solver. In the Solver Parameters dialog, set Set Objective to B4. Select Value Of and enter 120. In By Changing Variable Cells, enter B2:B3. Select Solve, review the result, and choose Keep Solver Solution if you want to retain it in the worksheet.
In this basic example, the area formula is nonlinear because it multiplies two changing cells. Solver will normally use GRG Nonlinear for a smooth nonlinear model. If your model is linear, choose Simplex LP; for a model with discontinuous or non-smooth relationships, Evolutionary may be more suitable. The choice depends on the formulas and constraints in the model, not just on the number of changing cells. Solver can also report that it did not find a solution or that it cannot improve the result, so check its status message rather than assuming every run succeeded.
Add constraints and check the result
Constraints tell Solver which combinations are allowed. In the rectangle example, you might require each dimension to be at least 1 and no more than 20. In Solver, use Add to enter constraints such as B2 >= 1, B2 <= 20, B3 >= 1, and B3 <= 20. These bounds prevent nonsensical dimensions, but they still leave numerous pairs that produce an area of 120.
Before accepting a result, check the worksheet itself. Confirm that the objective cell still contains the intended formula, that the changing cells are the correct inputs, and that the constraints match the real problem. Recalculate or substitute the proposed values and verify the target independently. Solver is a numerical search tool: its result can depend on starting values and model structure, and it does not decide whether the underlying assumptions make sense.
If a model contains integer-only decisions, such as a whole number of items, add an integer constraint for the relevant cell. If values must be binary choices, Solver supports binary constraints as well. These restrictions can make a search harder, and they may change the solving method or the solution found. Use them only when the real-world variable cannot take fractional values.
Build a two-variable Data Table
A two-variable Data Table is useful for sensitivity analysis. For the rectangle model, place a formula reference to the calculated area in the top-left corner of an empty table, then list candidate widths across the top row and candidate lengths down the first column. Select the entire grid, including the formula reference and both sets of inputs, then choose Data > What-If Analysis > Data Table. Set Row input cell to the worksheet cell for width and Column input cell to the worksheet cell for length.
Excel substitutes each pair of listed values into the model and displays the resulting area at the matching intersection. This makes it easy to see patterns or find a combination whose result is near a target. The row input cell and column input cell must be the original model inputs, not the labels or trial values in the table. If the results look wrong, check that the top-left cell points to the correct output formula and that the row and column input cells have not been reversed.
A Data Table is a what-if analysis tool, not a general-purpose search engine. It evaluates the combinations in its grid, so the selected ranges determine what it can show. It does not invent values outside those ranges or enforce Solver-style constraints. For a large or finely spaced grid, the table can also require substantial recalculation. Start with a manageable range, then expand or refine it if the results warrant more detail.
Goal Seek, Solver, and Data Tables compared
All three features are part of Excel’s What-If Analysis toolkit, but they present results differently. Goal Seek gives you one adjusted input for a selected target. Solver gives you a set of changing-cell values that meets a target or optimizes an objective, subject to constraints. A Data Table gives you a matrix of outcomes for input values you choose.
For instance, if the rectangle’s width is known and only its length is uncertain, Goal Seek can set the area cell to 120 by changing the length cell. If both dimensions are open questions and you want Excel to find a feasible pair, use Solver. If you want to compare areas for widths 8, 10, and 12 against lengths 8, 10, and 12, use a Data Table. A grid can help you understand the model before deciding which inputs or limits to use in Solver.
Solver is also different from Goal Seek because its objective can be to maximize or minimize a formula, not only make it equal a specified number. For example, a model might seek the lowest material use while meeting a required area and staying within dimension limits. That calls for an objective and constraints, not merely a target value. The quality of the answer still depends on the correctness of the worksheet model.
Mac and Excel for the web
In Excel for Mac, Solver is available as an add-in in desktop Excel. Enable it through Tools > Excel Add-ins, select Solver Add-in, and then use the Solver command on the Data tab. Ribbon labels and dialog layouts can differ slightly by Excel release, but the basic objective, changing cells, and constraints are the same.
Excel for the web does not provide the same desktop What-If Analysis workflow for running Goal Seek, Solver, or Data Tables. If you need to run one of these analyses, open the workbook in the desktop version of Excel. A workbook may still contain results or settings created on desktop, but do not assume the web app can perform the same calculation or expose the same controls.
Common problems and troubleshooting
If Solver is missing, first confirm that the add-in is enabled and that you are using desktop Excel. If it is present but does not find a useful result, inspect the formula and the changing cells. A fixed value mistakenly selected instead of an input cell, or an objective cell that does not depend on the changing cells, gives Solver nothing meaningful to adjust.
- No solution found: The target may conflict with the constraints, or the chosen bounds may exclude every feasible answer. Temporarily review the limits and test whether a valid combination can exist.
- Unexpected values: Check starting values, units, formula references, and whether the model has multiple valid solutions. Add only defensible constraints when the model is underdetermined.
- Results change between runs: Nonlinear searches can be sensitive to starting values and the selected solving method. Try sensible starting estimates and verify the final formula result.
- Goal Seek seems unable to solve the task: It only changes one cell. Switch to Solver for multiple changing cells rather than trying to enter a range into Goal Seek.
Keep a copy of the original inputs before solving if you need to compare scenarios. Solver changes worksheet values when you keep its solution, so recording the starting assumptions makes it easier to understand what changed and reproduce the analysis.
Frequently Asked Questions
Can Excel Goal Seek change two cells?
No. Goal Seek changes one cell at a time. Use Solver when Excel must adjust two or more cells toward a target.
Can a two-variable Data Table find the answer for me?
It calculates results for the input pairs you provide, but it does not search freely for an answer or automatically enforce constraints. Use Solver for that kind of search.
Why does Solver give different pairs for the same target?
There may be multiple valid solutions, as with two dimensions whose product must equal a fixed area. Starting values, constraints, and the solving method can affect which valid pair Solver returns.
Do I need to install Solver separately?
In desktop Excel, Solver is supplied as an add-in that may need to be enabled. On Windows, use File > Options > Add-ins; on Mac, use Tools > Excel Add-ins. Excel for the web does not offer the same Solver workflow.
Can Goal Seek work if my formula is not linear?
Yes. Goal Seek can adjust one input for a nonlinear formula, though the result may depend on the formula and starting value. For multiple changing inputs or additional constraints, Solver is the better fit.
Related
- Excel Named Range to Table: What Works and What Doesn’t
- Excel Consolidated Sum: Combine Data Across Sheets
- Excel: Consolidate Two Columns Into One Without Losing Data
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Lock Cells in Excel and Protect Your Sheet SafelyTo lock cells in Excel, first unlock any cells people should be able to edit, then protect the…
- Excel Text to Columns: Split Pasted Data Into FieldsTo split pasted data in Excel, select the column containing the combined text, then choose Data > Text…
- Google Sheets Australian Date Format: How to Set It UpTo use Australian dates in Google Sheets, set the spreadsheet locale to Australia through File > Settings >…
- Excel Time Shortcut: How to Insert the Current TimeIn Excel for Microsoft 365 on Windows, select a cell and press Ctrl+Shift+; (semicolon) to enter the current…
- Freeze a Group of Rows in Excel: Step-by-Step GuideTo keep several rows visible while you scroll in Excel for Microsoft 365 on Windows, select the first…
- Track a Budget in Google Sheets: A Practical GuideTo track a budget in Google Sheets, make one tab for transactions and another for your monthly plan,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.