Sub topic 13
Keeping Solved Models Reliable: Hardcodes, Circularity, Scaling, and Checks
Assume you can create Excel formulas, use absolute and relative references, and understand revenue, costs, profit, and cash flow. This chapter focuses on model hygiene: practices that keep a solved result meaningful after Goal Seek or Solver changes the model.
Separate inputs, formulas, and outputs
A target-seeking tool changes one or more variable cells. Those cells must contain values, not formulas. The target cell should contain a formula that responds to those values.
A reliable layout separates:
- Inputs: assumptions such as price, tax rate, units, or interest rate.
- Formulas: calculations that derive revenue, costs, cash flow, or profit.
- Outputs: results such as break-even units, project value, or required funding.
- Checks: formulas that test whether the model is valid.
For example, a break-even model can use units sold as the changing input:
B1: Units sold 1000
B2: Price per unit 50
B3: Variable cost 30
B4: Fixed costs 15000
B5: Operating profit =B1*(B2-B3)-B4Goal Seek can change B1 until B5 equals zero. Do not replace B1 with a formula such as =B4/(B2-B3). That formula may calculate the answer directly, but it prevents Goal Seek from treating B1 as a variable.
Distinguish intentional hardcodes
A hardcode is a value typed directly into a cell. Hardcodes are not automatically bad. An assumption such as a 30% tax rate belongs in an input cell. A number typed inside a long formula is harder to audit and easier to change accidentally.
Use one input cell for each important assumption. Reference that cell in formulas. Apply a consistent format, such as blue font for inputs and black font for formulas, if that convention is used by your team.
Detect and prevent circularity
A circular reference occurs when a formula depends on itself, directly or through other cells. For example, interest expense may depend on debt, while debt may depend on cash flow after interest expense.
| Problem | Why it threatens a solved result | Safer treatment |
|---|---|---|
| Debt depends on cash flow after interest, and interest depends on debt | The result may depend on iterative calculation settings | Separate the financing assumption or use a controlled schedule |
| A Solver variable is also calculated by a formula | Solver cannot freely change the variable | Make the variable a hardcoded input cell |
| A check cell is included in the objective | Solver may optimize the check instead of the business result | Keep checks separate from objectives |
Excel may allow iterative calculation to resolve a circular model. However, the displayed result then depends on iteration limits and tolerance settings. Document those settings if circularity is unavoidable. Prefer restructuring the model so the dependency flows in one direction.
Scale variables consistently
Poor scaling can make a numerical search slow or inaccurate. Avoid mixing dollars, thousands of dollars, and millions of dollars without clear labels. Likewise, store percentages consistently. A cell containing 10% has the numeric value 0.10, not 10.
For Solver, variables with very different magnitudes can make convergence harder. A model containing one variable near 0.02 and another near 5,000,000 may benefit from scaling the large variable in thousands or millions. Keep the unit conversion visible and ensure that constraints use the same units.
Add checks before trusting the answer
A solved value is useful only if it satisfies both the target and the business rules. Add checks such as:
- Target residual:
=TargetCell-DesiredValue - Balance check:
=Assets-Liabilities-Equity - Constraint slack:
=Capacity-UsedCapacity - Bounds check:
=AND(Variable>=Minimum,Variable<=Maximum) - Sign and direction checks, such as positive volume and nonnegative cash
After solving, confirm that the target residual is within an acceptable tolerance. Then change an input slightly and rerun the solve. A reasonable model should react in a direction that makes economic sense.
Use an independent calculation when possible. For the break-even example, the expected result is:
Fixed costs / (Price per unit - Variable cost) = 15000 / 20 = 750 units
If Excel reports a different value, inspect the formulas, units, and changing-cell selection before accepting it.
>callout warning >Never treat a Solver message such as “Solver found a solution” as proof that the solution is economically valid. Check the objective, every constraint, the variable bounds, and the residual independently.
Exercise
Exercise
A model uses units in cell B1, but B1 contains the formula =B6/B7. Goal Seek is asked to change B1 until profit reaches zero. What should you change before solving?
Show answer
Move the units calculation out of B1 or create a separate input cell for units. The changing cell must be a value that Goal Seek can alter, and the profit formula must reference that value.