What Are Hardcodes in Financial Models?
Ask any reviewer what kills a model, and hardcodes are near the top of the list. A hardcode is a fixed number that has been placed where a flexible, traceable input should be. Understanding them is the first step to building models that hold up under scrutiny.
What counts as a hardcode
A hardcode is any constant that overrides or replaces a proper input. It usually shows up in two forms.
- A typed number sitting where a formula should be, for example a quarter where someone overwrote the calculation with last year's actual.
- A constant embedded inside a formula, such as
=Revenue*1.05for a growth rate or=COGS+50000for a manual adjustment. - A magic number with no label or source, like
=B4*0.21where 0.21 is a tax rate nobody documented.
Why hardcodes cause errors
The danger is that a hardcode breaks the chain of logic. When an assumption updates, every input cell flows through automatically, but a buried 1.05 does not. The model then reports a mix of new and old assumptions, and the inconsistency is invisible unless someone reads each formula. Hardcodes also make sensitivity analysis impossible, since you cannot flex a number you cannot find.
Hardcodes versus inputs
The fix is not to ban constants. Every model needs assumptions. The fix is to put each one in its own labeled input cell, color it as an input, and reference it from formulas. A growth rate lives in a cell called Growth, and the revenue line reads =Prior*(1+Growth). Now the number is documented, traceable, and flexible.
How to audit a model for hardcodes
Reviewing a model means hunting down every constant that should have been an input. You can use Go To Special (F5 then Special then Constants) for typed-over cells, but the embedded plugs inside formulas are far harder to catch by eye. ModelMint Find Hardcodes lists every formula containing a hardcoded number in one pass, so a review that used to mean reading hundreds of formulas becomes a single scan.
Find Hardcodes
Surface every formula that contains a hardcoded number so you can move buried assumptions into clean, labeled input cells.
Get ModelMint See how it worksFAQ
Is a hardcode always bad?
Not always, but a hardcoded number should live in a clearly labeled input cell, not be buried inside a formula. A constant like a tax rate is fine as an input. The same rate typed directly into a formula is a hardcode that hides the assumption.
What is a magic number in a spreadsheet?
A magic number is a constant with no label or documented source, such as 0.21 inside =B4*0.21. Because no one knows where it came from, it is risky to update and easy to leave wrong.
How do I prevent hardcodes when building a model?
Keep a dedicated assumptions area, give every constant its own labeled cell, color inputs distinctly, and reference those cells from formulas. Audit periodically to catch plugs that crept in during edits.