Hardcode
Executive Summary
Key Takeaways
- ✓ A hardcode is a typed value inside a formula cell, in place of a reference to an assumption or another calculated cell.
- ✓ The risk is not the value itself but the disconnection it creates — the cell no longer responds when the model's stated inputs change.
- ✓ A hardcode inside an otherwise formula-consistent row is a materially different case from a genuine input cell on a dedicated assumptions tab.
- ✓ Structural constants intrinsic to a calculation are a different case from a business assumption typed in place of a reference, and are treated differently by rule-based detection.
Definition¶
A hardcode is a numeric, date, or text value typed directly into a formula cell, in place of a reference to an assumptions tab, a named input, or another calculated cell. The term is used specifically for a typed value that appears inside a row or column of otherwise formula-driven cells, disconnecting that one cell from the pattern the rest of the row follows.
A dedicated, intentional input cell on an assumptions or inputs worksheet, designed to be typed by the model's user, is not a hardcode in this risky sense. The concern is a typed value embedded inside what should be a live calculation.
Why It Matters¶
The risk a hardcode creates is not the specific value entered, but the disconnection it produces between the model's stated assumptions and its actual output. If a formula row calculates revenue by applying a growth rate from the assumptions tab, and one cell in that row instead contains a typed number, changing the growth rate assumption will update every cell in the row except that one. The model will appear to respond correctly to the changed assumption while silently carrying a stale, disconnected figure in one cell, with no visible indication that anything is wrong.
This failure mode is particularly dangerous because it does not produce an error message or a broken formula; the cell still returns a plausible-looking number. It is only detectable by comparing the cell's actual content against the pattern the surrounding cells establish, which is exactly what both a careful manual reviewer and a rule-based structural audit are designed to check.
Technical Background¶
The Row-Pattern Detection Principle¶
The standard method for detecting a risky hardcode, used in both manual review and automated rule-based auditing, is to compare a cell against the formula pattern established by the surrounding cells in the same row or column. If the interior cells of a row consistently apply the same formula logic, and one interior cell instead contains a typed value, that cell is flagged. The first and last cell of a row are typically excluded from this comparison, because a genuinely different value at the edge of a row, a ramp-up first period or a terminal value, is common and legitimate rather than an error.
Legitimate vs Risky Hardcodes¶
Not every typed value is a risk. A structural constant intrinsic to a calculation, such as a unit conversion factor or a mathematical constant, is a different case from a business assumption, a growth rate, a price, an interest rate, typed directly into a formula cell in place of a reference to the assumptions tab. Rule-based detection is designed to distinguish these cases by focusing on interior-row pattern breaks rather than flagging every numeral present in the workbook.
Related Detection Categories¶
Hardcoding shows up under several related, more specific structural checks in a mature audit methodology: a hardcoded rate or constant embedded repeatedly across a model, a hardcoded date used in place of a date-driven schedule, and a high density of hardcoded cells concentrated in one area of a model, each of which is a variant of the same underlying disconnection risk. See R001 — Hardcoded Cells for the specific detection logic used by the FMAE rule engine.
Common Errors¶
| Error | Description | Risk |
|---|---|---|
| Hardcode inside a formula row | Typed value breaks an otherwise consistent row pattern | Cell does not update when assumptions change |
| Copy-pasted value instead of formula | A formula result pasted as a static value during model updates | Same disconnection risk, introduced accidentally rather than deliberately |
| Repeated hardcoded rate | The same rate typed into multiple cells instead of referenced from one assumption | Updating the assumption misses every cell where it was typed separately |
| Hardcoded date | A specific date typed into a schedule instead of derived from a start date and period logic | Schedule does not roll forward correctly when the model's timeline changes |
Best Practices¶
Keep every business assumption, growth rates, pricing, rates, on a dedicated assumptions or inputs tab, and reference it from formula cells rather than typing values directly into calculation rows. Where a genuinely different value is needed at the edge of a schedule, a ramp-up period or a terminal assumption, document why it differs rather than leaving it unexplained. Run a structural check for interior-row pattern breaks before relying on a model for a material decision, since a hardcode of this kind is not visible from a plausible-looking output alone.
Continue Reading¶
Related Pillars¶
Related Glossary¶
Related Rule Reference¶
How OXXON tests thisRun a free structural check with FMAE
Frequently Asked Questions
What is a hardcode in a financial model?
A typed numeric, date, or text value entered directly into a formula cell, in place of a reference to an assumptions tab or another calculated cell.
Why is hardcoding considered a structural risk rather than just a style preference?
Because a hardcoded value does not update when the model's stated assumptions change, which silently disconnects the model's output from its own inputs and can cause the model to present a stale or incorrect result without any visible error.
Are all numeric values in a model considered hardcodes?
No. A dedicated input cell on an assumptions or inputs tab, intended to be typed, is not a hardcode in the risky sense. The concern is a typed value inside a formula cell in a row where the surrounding cells otherwise follow a consistent formula pattern.
Is a structural constant, like a unit conversion factor, treated the same as a hardcoded assumption?
No. A constant intrinsic to a calculation itself is a different case from a business assumption, such as a growth rate or a price, typed directly into a formula in place of a reference. Rule-based detection targets the latter specifically.
How does an automated audit engine detect hardcodes?
By identifying a row where the surrounding formula cells establish a consistent pattern, and flagging any cell within that pattern that contains a typed value instead of the row's formula, described on the R001 Hardcoded Cells rule reference page.
What is the difference between a hardcode and a broken link?
A hardcode is a value typed in place of a formula reference. A broken link is a formula reference that points to a source that no longer exists or resolves incorrectly. Both disconnect a cell from its intended data source, through different mechanisms, described on the Broken Link glossary entry.
Related Articles
Structural Risk
Structural risk in the context of financial modelling is the risk of model failure arising from errors, inconsistencies, or weaknesses in the model's design, architecture, and internal logic — as distinct from the risk arising from incorrect input assumptions or adverse external outcomes. Structural risk exists within the model itself, regardless of the accuracy of the assumptions fed into it. A model with high structural risk will produce incorrect outputs even when its inputs are correct. This makes structural risk particularly dangerous: it cannot be remediated by revising assumptions or updating market data. It requires identifying and correcting the model's internal logic.
Named Range
A named range is a label assigned to a specific cell or range of cells in Microsoft Excel (or another spreadsheet application) using the Name Manager. Once named, the label can be used in formulas instead of the cell's coordinate reference (such as B12 or Sheet1!B12), making formulas more readable and reducing the likelihood of reference errors. Named ranges can refer to a single cell, a range of cells, a constant value, or a formula. They are defined at either the workbook level (accessible from any sheet) or the sheet level (accessible only from a specific sheet).
Data Table
In Excel, a data table is a range of cells that performs a series of what-if calculations by substituting a set of input values into one or two designated cells and recording the resulting output from a specified formula. Data tables are the standard mechanism for producing sensitivity matrices in financial models. A one-variable data table varies one input and shows the output for each value; a two-variable data table varies two inputs simultaneously. Data table results are stored as array formulas using the TABLE function and update automatically when the model recalculates, unless the workbook's calculation mode excludes data tables from automatic recalculation.
Deterministic Audit
A deterministic audit is a financial model audit performed by applying a fixed, disclosed rule set systematically to a model's formulas and structure, such that running the same audit against the same model produces the same findings every time. It is distinguished from both manual, judgement-based review and generative AI-based review, neither of which is guaranteed to be repeatable in this sense.