Stockertim Dictionary · Technology
Hard-coded value
Also called hard code, hardcode, hard-coded number, hardcoded value, hard-coding
In short
A number typed directly into a formula or calculation cell instead of being linked to a labelled input; a common cause of errors in financial models.
- Advanced
- Concept
- Checked
In detail
In a well-structured model, assumptions live on an inputs sheet, clearly labelled, and every calculation refers to them. A hard-coded value breaks that rule: a growth rate typed as 1.05 inside a revenue formula, a tax rate of 0.25 written into a profit line, or a figure pasted over a formula to make a total look right. The model still works on the day it is built, but the number is hidden where no one expects to find it.
The trouble starts when assumptions change. Someone updates the tax rate on the inputs sheet, but the hard-coded copy in a later row stays at the old value, so the model quietly mixes two rates. Overwritten formulas are worse, because the cell looks like every other cell in the row yet no longer responds to anything. Reviewers find many errors simply by searching for constants inside formulas and for rows where the formula pattern breaks.
Not every typed number is a problem. Historical figures from published accounts, conversion constants such as 12 months in a year, and clearly labelled one-off inputs are expected. The aim is that every assumption a user might want to change appears once, in a visible place, with its source noted. Many teams colour-code inputs, often blue for typed values and black for formulas, so hard-coding stands out.
Worked example
A model's inputs sheet sets the tax rate at 25%, but one formula reads profit × 0.19, left over from an earlier version. Profit before tax in that year is £40m.
- Tax using the input: £40m × 25% = £10m
- Tax using the hidden constant: £40m × 0.19 = £7.6m
- Understatement: £10m − £7.6m = £2.4m
The stray constant understates tax by £2.4m in that year and is invisible unless someone inspects the formula.
In practice
Model reviewers and audit software flag constants embedded in formulas as a standard test. Modelling style guides in banks and the public sector require inputs to be separated from calculations and formatted differently.
Watch out
- Overwriting a formula with a number to fix a total hides the real problem and breaks future updates.
- Historical data entered once as inputs is not the same as hard-coding inside calculations.
Learn it properly
Official sources
Facts last checked on 4 November 2026.
Education, not advice: the Stockertim Dictionary explains what terms mean. It never recommends buying or selling anything.