Sub topic 4
Keeping inputs clean: units, sources, and no hardcodes
This chapter assumes you can build a basic three-layer model and read absolute references such as $C$5. It also assumes you know what an input is: any number that a person chose, estimated, or looked up, rather than computed. The chapter covers what keeps the inputs layer trustworthy once it exists.
Why input hygiene matters
The inputs layer is the only place where a human opinion enters the model. Everything downstream is arithmetic. If an input is ambiguous, stale, or duplicated, every output inherits the problem, and no amount of careful calculation repairs it.
Three failures account for most input trouble:
- Unit confusion. A cell holds
5and nobody knows whether it means 5%, 5 million, or 5 months. - Unknown origin. A number is correct today, but nobody can say where it came from, so nobody can update it.
- Hardcodes. A constant sits inside a formula, so changing an assumption means hunting through the calculations.
Clean inputs address all three. Each input has a label, a unit, a source, and exactly one home.
Units belong in the name
A number without a unit is a guess. Put the unit where the reader cannot miss it, in the label or in an adjacent column, and use one convention across the model.
| Quantity | Weak label | Better label | Stored as |
|---|---|---|---|
| Growth | Growth | Revenue growth, fraction per year | 0.10 |
| Cost ratio | COGS | COGS, fraction of revenue | 0.60 |
| Opening sales | Revenue | Year 1 revenue, currency units | 1,000,000 |
| Payment terms | Days | Receivable days, days | 45 |
| Lease | Rent | Rent, currency units per month | 12,500 |
Rules that prevent most unit errors:
- Store percentages as fractions and format them as percentages. The cell holds
0.10and displays10.0%. Typing10into a cell formatted as a percentage is a classic trap, so test the cell after entry. - Pick one currency scale. If the model is in thousands, every monetary input is in thousands. Mixing a revenue figure in units with a cost figure in thousands gives a result wrong by a factor of 1,000, and the formula looks fine.
- Match the period to the time axis. A monthly model needs monthly rates. If you receive an annual rate, convert it once, in the calculations layer, and show the conversion visibly.
- Keep sign conventions explicit. Decide whether costs are entered as positive numbers that the model subtracts, or as negatives that it sums. State the choice and apply it everywhere.
Sources and dates
Give each input three pieces of metadata next to its value: where it came from, who owns it, and when it was last confirmed. A layout that works well is one row per input with these columns:
| Label | Value | Unit | Source | Owner | Last reviewed |
|---|---|---|---|---|---|
| Revenue growth | 0.10 | fraction per year | Budget memo, March 2026 | Finance | 2026-03-14 |
| Tax rate | 0.25 | fraction of positive EBIT | Tax advisor email | Tax | 2026-02-01 |
A source such as "management estimate" is acceptable if it is true, because it tells the reader this number is a judgment and deserves scrutiny in sensitivity analysis. A blank source is not acceptable. It tells the reader nothing, and it often means the number was a placeholder that was never replaced.
Distinguish three kinds of input in the source column: hard data (a contract price, a statutory tax rate), forecast assumptions (growth, margins), and placeholders. Mark placeholders clearly, for example with a "TBC" tag, so they show up when you filter.
No hardcodes in formulas
A hardcode is a constant typed inside a formula. Compare two versions of the same revenue formula:
Calc!E10 = D10*(1+0.10)
Calc!E10 = D10*(1+Inputs!$C$5)The first works today. The second can be changed in one place, audited by anyone who traces the reference, and flexed by a scenario switch. The first also hides a trap: when the growth assumption changes, you must find every copy of 0.10, and some of them will be missed.
The rule has some sensible edges:
- Structural constants are fine.
1in(1+growth),0inMAX(x,0), and2when halving a figure are part of the formula's logic, not assumptions. - Unit conversions need care.
12months per year is a true constant, but burying it makes formulas harder to read. Many teams put conversions such as months per year in a small labeled constants block on the Inputs sheet. - Overrides inside a calculation row are hardcodes too. Typing
500000over one formula in a row of formulas is the most dangerous form, because the row looks consistent until the totals drift. The next chapter in this series covers row consistency in detail.
Finding hardcodes automatically
You can scan formulas for suspicious literals. The Python sketch below checks formula strings the way an audit macro would, after removing cell references and quoted text so that E10 and "All checks pass" are not mistaken for numbers.
import re
ALLOWED = {"0", "1"} # structural constants that are not assumptions
def find_hardcodes(formula):
"""Return numeric literals in a formula that are not cell references."""
text = re.sub(r'"[^"]*"', "", formula) # drop quoted strings
text = re.sub(r"\$?[A-Z]{1,3}\$?\d+", "", text) # drop references like E10, $C$5
numbers = re.findall(r"\d+(?:\.\d+)?", text)
return [n for n in numbers if n not in ALLOWED]
formulas = {
"Calc!E10": "=D10*(1+0.10)",
"Calc!E12": "=E10*(1-Inputs!$C$6)",
"Calc!E15": "=MAX(E13,0)*0.25",
"Outputs!B2": '=IF(Checks!C10=0,"All checks pass","CHECK ERRORS")',
}
for cell, formula in formulas.items():
found = find_hardcodes(formula)
status = "HARDCODE " + ", ".join(found) if found else "ok"
print(f"{cell:12} {status}")Running it flags 0.10 in Calc!E10 and 0.25 in Calc!E15, and passes the other two. The scan is deliberately crude. A sheet name that contains digits, such as Calc2, would confuse it, so treat the output as a list of places to look at, not a verdict. In Excel itself, Go To Special > Constants highlights typed numbers on a calculation sheet, and any highlighted cell outside the inputs layer deserves a question.
Validating inputs
Clean inputs are not only labeled but also plausible. Add validation so an impossible value cannot sit unnoticed. In a spreadsheet, use data validation to restrict a percentage cell to a range between 0 and 1. In code, check each input against its bounds when the model loads.
inputs = {
"growth_rate": {"value": 0.10, "unit": "fraction per year",
"source": "Budget memo, March 2026", "low": -0.5, "high": 1.0},
"cogs_pct": {"value": 0.60, "unit": "fraction of revenue",
"source": "FY2025 actuals", "low": 0.0, "high": 1.0},
"tax_rate": {"value": 25, "unit": "fraction of positive EBIT",
"source": "", "low": 0.0, "high": 0.6},
}
def validate(inputs):
problems = []
for name, item in inputs.items():
if not item["source"].strip():
problems.append(f"{name}: missing source")
if not item["low"] <= item["value"] <= item["high"]:
problems.append(
f"{name}: {item['value']} outside {item['low']}..{item['high']} ({item['unit']})"
)
return problems
for problem in validate(inputs):
print(problem)This prints two problems for tax_rate: it has no source, and the value 25 is outside the allowed range. That is the typical percentage-entry mistake, caught before it reaches any output. The structure of the dictionary, with value, unit, source, and limits kept together, is the code equivalent of one well-labeled row on the Inputs sheet.
The life of a clean input
The diagram shows the path a number should follow when you find it buried in a formula.
The last step matters. A correct refactor changes the structure but not the results, so compare the outputs before and after.
One home per input
Each assumption should be entered once. If the same growth rate appears on the Inputs sheet and again as a typed number on a sheet for another division, the two will diverge. Where a division needs its own value, give it a separate, labeled input, and make any shared default a visible reference to the global input rather than a retyped copy.
Inputs that vary by period, such as a price path over five years, still count as inputs. Put them in a row on the Inputs sheet laid out along the same time axis as the calculations, so each calculation column reads from the input in its own column.
Common mistakes
- Percentage typed as a whole number.
25in a cell meant to hold0.25. Prevent it with validation and a unit label. - Inputs scattered across sheets. Assumptions typed into calculation sheets "just for now" become permanent.
- Formatting that disguises a value. A cell shows
10%but holds0.0996. Check the underlying value when auditing. - Stale placeholders. Review dates make these visible. An input last reviewed two years ago should be questioned.
Exercise
A formula in a calculation row reads =E14*0.19, and the Inputs sheet has no entry for 19%. List the steps you take to fix it, and say what you check afterwards.
Show answer
Add a new row on the Inputs sheet with a label (for example "Sales tax rate"), the value 0.19 stored as a fraction and formatted as a percentage, the unit "fraction of sales", a source, an owner, and a review date. Replace 0.19 in the formula with an absolute reference to that cell, such as =E14*Inputs!$C$12, and copy the same formula across the whole row. Afterwards, confirm that the outputs are identical to those before the change, and that no other formulas contain the same typed 0.19.
Exercise
An input cell shows 8.0% but a colleague says the model's tax charge is far too small. Name two things to check in the input cell.
Show answer
Check the underlying value and the cell format. The cell may hold 0.08 formatted as a percentage, which is correct, or it may hold 8 or 0.0008 displayed misleadingly through formatting or a unit mismatch. Also check the unit label and the source, to confirm the value is meant to be a fraction of the right base, such as a fraction of positive EBIT rather than of revenue.