The guide · References instead of typed numbers
What "hard-coded" means
A hard-coded value is a number typed straight into a formula. =B2*0.08 works out the tax, but the 8% lives inside the formula, where nobody can see it on the sheet. When the rate changes, someone has to find every formula that contains it. The ones they miss stay wrong, and Excel shows no error.
Why it's hard to spot
A hard-coded formula gives the right answer on the day it's written. In this hunt, C4 is =B4*0.08: correct at today's 8%, so nothing looks off. It breaks at the next change. The cell doesn't tell you; only the formula bar does.
How to find them
- Click each formula and read the formula bar. Look for digits that aren't part of a cell reference:
0.07,7%,1.2. - In Excel, Ctrl+` (Show Formulas) shows every formula at once instead of its result.
- Change an input and watch. If a result doesn't move when the rate does, that formula has the rate typed in.
The fix
Put each assumption in its own labeled cell, like Tax rate in G1, and point every formula at it. Lock it with $ so you can fill down: =B2*$G$1. Now changing G1 updates the whole quote. The absolute reference challenge covers the $.
Which numbers are fine to type in
Numbers that can't change: 12 months in a year, 7 days in a week, the 1 in =C2/B2-1. Anything that could change, like a rate, a price, a target or a threshold, belongs in a cell of its own.
Common mistakes
- Fixing only the cells that look wrong. The hard-coded formula that matches today's rate is the one that bites later.
- Typing the new rate over the old one.
=B3*0.08is right today and wrong again at the next change. - Pointing at G1 without $. Filled down, it becomes G2, an empty cell, and the tax drops to 0.
FAQ
- What is a hard-coded value in Excel?
- A number typed directly into a formula, like the 0.08 in =B2*0.08, instead of a reference to a cell that holds it.
- Why is hard-coding values in formulas bad?
- The value is hidden inside the formula. When it changes, every formula that contains it has to be found and edited, and any you miss stay wrong without showing an error.
- How do I find hard-coded numbers in Excel?
- Press Ctrl+` to show formulas and look for digits that aren't cell references. Or change an input cell and see which results don't follow.
- How do I replace a number in a formula with a cell reference?
- Put the number in a labeled cell, then edit the formula to point at it, locked with $ if you will copy the formula: =B2*$G$1.