Sub topic 5
How the search works: iteration, tolerance, and approximate answers
This chapter assumes you can run Goal Seek (set cell, to value, by changing cell) and know the basics of PMT and IRR. It explains what happens between clicking OK and seeing "Goal Seeking with Cell B5 may not have found a solution." You will learn when Goal Seek decides it is finished, why its answer is usually slightly off, and how to check and tighten that answer.
Goal Seek is a loop, not a formula
A forward calculation evaluates formulas once, from inputs to outputs. Goal Seek works the other way. It cannot invert your formulas, so it guesses and checks:
- Read the current value of the changing cell.
- Recalculate the model and read the set cell.
- Compare the set cell with the target.
- If the gap is small enough, stop. Otherwise choose a new value for the changing cell and repeat.
Microsoft does not publish the exact update rule. Its behavior resembles a Newton or secant method: it estimates how much the set cell moves per unit change of the input, then jumps to where that slope says the target should be. Treat that as a working model. The stopping rules below are documented and are what matter in practice.
The two settings that control stopping
Goal Seek reads two options from File > Options > Formulas, in the Calculation options section:
| Setting | Default | What it controls in Goal Seek |
|---|---|---|
| Maximum Iterations | 100 | How many guesses Goal Seek makes before giving up |
| Maximum Change | 0.001 | How close the set cell must be to the target value to count as solved |
These are the same fields used for circular-reference iteration. You do not need to tick "Enable iterative calculation" for Goal Seek to use them. Changing them affects both features.
Tolerance is measured in the output, so scale matters
The same 0.001 means very different things depending on what the set cell holds.
- Set cell is operating profit in dollars. Being within 0.001 is a tenth of a cent. That is more than adequate.
- Set cell is a margin or return stored as a decimal, such as 0.05. Within 0.001 means within 0.1 percentage points. Goal Seek may stop at 4.95% or 5.05% and call it solved.
- Set cell is in millions and the model displays it in millions, for example 12.5. Within 0.001 means within $1,000. That may or may not be acceptable.
You have three ways to handle a coarse tolerance:
- Lower Maximum Change, for example to 0.000001, before running Goal Seek.
- Set the target on a rescaled helper cell, such as
=(Margin-Target)*10000for basis points, with target value 0. - Run Goal Seek, then verify with a check cell and rerun if the gap is too large.
Iteration settings belong to the Excel application session, not to each workbook. Excel generally takes them from the first workbook opened. If a colleague's file behaves differently from yours, compare these settings first.
Watching the search converge
The loan example shows the loop at work. Suppose you want the annual rate at which a 30-year, $200,000 loan has a monthly payment of exactly $1,200. The payment is a nonlinear function of the rate, so one linear step will not land exactly on it. The Python below runs a secant search with Goal Seek's default stopping rules and prints each guess.
def payment(annual_rate, principal=200_000, years=30):
r = annual_rate / 12
n = years * 12
return principal * r / (1 - (1 + r) ** -n)
def gap(rate):
return payment(rate) - 1200 # set cell minus target
def secant(f, x0, x1, tol=0.001, max_iter=100):
f0, f1 = f(x0), f(x1)
for i in range(1, max_iter + 1):
print(f"iter {i}: x={x1:.8f} gap={f1:.6f}")
if abs(f1) <= tol:
return x1, True
if f1 == f0:
return x1, False # flat: no slope to follow
x2 = x1 - f1 * (x1 - x0) / (f1 - f0)
x0, f0 = x1, f1
x1, f1 = x2, f(x2)
return x1, False
rate, ok = secant(gap, 0.05, 0.07)
print(ok, rate)The rate settles near 0.06007, about 6.007%. The gap shrinks very quickly, typically from tens of dollars to under a cent within a handful of iterations. Smooth, monotonic functions converge fast. That is why Goal Seek feels instant on break-even and loan problems.
When a small output gap hides a large input error
Tolerance on the output translates into input error through the slope. Where the formula is steep, a tiny output gap means a tiny input error. Where it is flat, the input can be far from the answer while the output already looks solved.
The cubic below is flat near its root at x = 2:
for tol in (1e-3, 1e-6, 1e-9):
worst_input_error = tol ** (1 / 3) # solve |x - 2|**3 = tol
print(f"output tolerance {tol:g} -> input may be off by {worst_input_error:.4f}")An output tolerance of 0.001 allows the input to be 0.1 away from the true root. Tightening the tolerance by a factor of a million improves the input only by a factor of a hundred. Financial examples include a set cell that barely responds to the changing cell, such as a valuation that depends only weakly on a terminal growth input, or NPV near an IRR where cash flows are small.
Why the answer is not exactly round
After Goal Seek, the changing cell often holds something like 749.99998 instead of 750. That is normal. Three causes combine:
- The stopping rule accepts any set-cell value within tolerance, so the search stops as soon as it is close.
- Excel stores numbers as binary floating-point values with about 15 significant digits, so many decimals cannot be represented exactly.
- The input is a number Goal Seek typed in. It is not derived from the model, so it will not change when other assumptions change.
Do not round the result by hand and assume the target still holds. Check it.
A verification habit
Add a check cell beside every solved model. It makes the approximation visible and gives you something to test automatically.
A7: Target profit B7: 0
A8: Gap to target B8: =B5-B7
A9: Solved within 0.01? B9: =IF(ABS(B8)<=0.01,"OK","RE-RUN GOAL SEEK")After each Goal Seek run, confirm that B9 reads OK. If you change any assumption afterward, the solved input is stale, B8 moves away from zero, and B9 flags it. The model does not re-solve itself, so this flag is your only warning.
Reading the failure message
Goal Seek reports "may not have found a solution" when it hits Maximum Iterations without meeting the tolerance. The cell still holds its last guess, which is often meaningless. Typical reasons, covered in the next chapters, include:
- The target is unreachable for any input, so the search wanders or stalls.
- The starting value sits on a flat region where the estimated slope is near zero, so the next step is huge or undefined.
- The function has several roots and the search converges to a different one than you wanted.
- The formula chain contains a discontinuity, such as an IF threshold or a rounding step, so no smooth slope exists.
Two quick responses help. First, change the starting value to something close to the expected answer and run again. Second, raise Maximum Iterations only if the Step button, in the Goal Seek status dialog, shows the gap still shrinking steadily. If the gap is not shrinking, more iterations will not help.
Summary of practical rules
- Goal Seek stops when the set cell is within Maximum Change of the target, or after Maximum Iterations guesses.
- Tolerance applies to the output. Convert it to input error with the slope.
- Rescale percentages and very small outputs before seeking, or lower Maximum Change.
- Add a gap check cell and re-run after any assumption changes.
- Treat a failure message as information about the model's shape, not only a request for more iterations.
Exercise
A model's set cell is a project IRR stored as a decimal (for example 0.1250). You run Goal Seek with target 0.12 and default settings, and it reports success with IRR = 0.1204. Why can this happen, and what are two ways to get an answer within 0.00001?
Show answer
The default Maximum Change of 0.001 is measured on the set cell, so any IRR within 0.001 of 0.12 (0.119 to 0.121) counts as solved. A 0.0004 gap is inside that tolerance. Two fixes: lower Maximum Change to 0.000001 in File > Options > Formulas before running Goal Seek, or use a rescaled helper cell such as =(IRR-0.12)*10000 with target value 0, so the 0.001 tolerance corresponds to 0.0000001 in IRR terms.
Exercise
After Goal Seek reports a solution for a break-even model, you change the price assumption from 50 to 55. The units cell still shows 750. Is the break-even still valid, and how would your model show it?
Show answer
No. Goal Seek stored a fixed number in the units cell. It does not re-solve when other inputs change. The profit cell now shows 750*(55-30)-15000 = 3,750, so a gap check cell such as =B5-0 or an IF flag would show the model is no longer at its target. You must run Goal Seek again, which gives 600 units.
Exercise
A set cell is almost flat with respect to the changing cell near the answer (the slope is about 0.0001 per unit). Goal Seek reports success with Maximum Change 0.001. Roughly how far could the input be from the exact answer, and what does this tell you about trusting the dialog?
Show answer
A gap of 0.001 in the output with a slope of 0.0001 per unit allows an input error of about 0.001 / 0.0001 = 10 units. The success message only confirms the output tolerance. With a flat response, the input can be far off, so tighten Maximum Change, rescale the set cell, or test sensitivity by nudging the input and observing how the output moves.