ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Comparisons
  3. Hardcoded Numbers vs Cell References in Excel Formulas

Hardcoded Numbers vs Cell References in Excel Formulas

By ExcelReady Team·Updated December 1, 2026·7 min read

The short answer

Put any number that could change, such as a tax rate, commission rate or target, in its own input cell and point your formulas at it with an absolute reference like $E$1. Then one edit updates every result. Hardcode only true constants that never change, such as 12 months in a year or 100 in a percentage.

Key takeaways

  • A hardcoded number is a value typed inside a formula, like the 0.04 in =B2*0.04.
  • An input cell holds the number once, and every formula points to it, so one change updates them all.
  • Lock the input cell with $ ($E$1) so the reference doesn't move when you fill the formula down.
  • Hardcoding is fine for fixed facts, like 12 months or 7 days, that will never be edited.
  • Show Formulas (Ctrl+` on Windows and Mac) and Trace Precedents help you find numbers hidden inside formulas.
On this page+
  1. Hardcoded numbers vs cell references at a glance
  2. A side-by-side example: a sales commission sheet
  3. Why the input cell needs a $ sign
  4. When to use cell references (input cells)
  5. When hardcoding is fine
  6. How to find hardcoded numbers in a sheet
  7. What a job test usually checks
  8. Common mistakes with hardcoded numbers
  9. Our recommendation
  10. Practise it

Hardcoded numbers in Excel formulas are values typed straight into the formula, like the 4% in =B2*0.04. A cell reference points to a cell that holds the value instead, like =B2*$E$1. Use cell references for anything that might change, and hardcode only fixed facts such as 12 months in a year. This guide is for anyone building sheets other people will check, and for job seekers who want their test answers to look like real work.

Hardcoded numbers vs cell references at a glance#

The difference is where the number lives: inside every formula, or once, in a cell everyone can see.

FeatureHardcoded (=B2*0.04)Cell reference (=B2*$E$1)
Where the number livesInside each formulaIn one input cell
Can a reader see the assumption?Only by opening each formulaYes, it's on the sheet
Changing the rateEdit every formulaEdit one cell
Risk when it changesA missed formula stays wrong, with no errorNone, every formula updates
Works for "what if" testsNoYes, type a new value and watch
Good forFixed facts: 12, 7, 24, 100Rates, prices, targets, thresholds
Needs $ when filled down?NoYes, lock the input cell

A side-by-side example: a sales commission sheet#

Here is the same commission sheet built both ways. Each rep earns 4% of their sales.

ABCDE
1RepSalesCommissionRate4%
2Ana18,400
3Ben22,150
4Chloe9,800
5Dev31,000

Version 1, hardcoded: C2 holds =B2*0.04, filled down to C5. Version 2, cell reference: C2 holds =B2*$E$1, filled down to C5.

Both give the same results today:

RepSalesCommission at 4%
Ana18,400736
Ben22,150886
Chloe9,800392
Dev31,0001,240
Total81,3503,254

Now the sales manager raises the rate to 4.5%.

  • Cell reference version: type 4.5% in E1. Every row updates at once: 828, 996.75, 441 and 1,395, for a total of 3,660.75.
  • Hardcoded version: you open C2, C3, C4 and C5 one by one and change 0.04 to 0.045. Say you miss C4. Chloe stays at 392 instead of 441, and the total shows 3,611.75. That's 49 short, and nothing on the sheet looks wrong.

With 4 rows, you might catch it. With 400 rows spread over several sheets, you probably won't. That's the real cost of hardcoding: not the typing, but the silent mistake.

Why the input cell needs a $ sign#

The input cell must be locked with an absolute reference ($E$1) so it doesn't move when you fill the formula down. Without the $ signs, =B2*E1 in C2 becomes =B3*E2 in C3. E2 is empty, so Ben's commission shows 0, again with no error.

You don't have to type the dollar signs. While editing, put the cursor on E1 and press F4 on Windows, or ⌘T (or fn+F4) on a Mac. Our comparison of relative vs absolute references explains all four reference types, and mixed references cover grids where you lock only the row or only the column.

When to use cell references (input cells)#

Use an input cell for any number that is a decision, an estimate or a figure someone else gave you. That covers most numbers in business sheets.

  • Rates: tax, commission, discount, interest, exchange rates.
  • Prices and costs: a unit price, a shipping fee, an hourly rate.
  • Targets and thresholds: a sales target in =IF(B2>=$E$2,"Bonus",""), a minimum order size, a pass mark.
  • Dates that drive a report: a period end date or a cut-off.

Group these inputs in one clearly labelled area, often at the top of the sheet or on a separate Inputs sheet. Many people colour input cells differently so readers know what they're allowed to change. Excel's Home > Cell Styles gallery includes an Input style for exactly this. Building a model around a tidy set of inputs is the core idea behind any Excel financial model.

Named inputs: an easy upgrade#

You can give the input cell a name and use it in formulas. Select E1, click the Name Box to the left of the formula bar, type CommissionRate and press Enter. Now you can write:

Excel formula
=B2*CommissionRate

It reads like a sentence, and a name never shifts when you fill down, so you don't need $ signs. The trade-offs are covered in named ranges vs cell references.

When hardcoding is fine#

Hardcode a number only when it's fixed by definition and nobody would ever edit it. Good examples:

  • =B2/12 to turn an annual salary into a monthly one.
  • =C2*24 to turn a fraction of a day into hours.
  • =B2*(1+$E$1). The 1 means "the full price" and never changes; only the rate lives in a cell.
  • =ROUND(C2,2) to round to 2 decimal places.

A simple test: if the number could be different next month, or someone might ask "where did that come from?", give it a cell. A VAT rate or a commission rate fails that test, even if it hasn't changed in years.

How to find hardcoded numbers in a sheet#

Excel has a few built-in tools that make hidden numbers visible.

  1. Show Formulas. Press **Ctrl+** (the grave accent key, usually above Tab) on Windows or Mac, or go to **Formulas > Show Formulas**. Every cell shows its formula instead of its result, so =B20.04stands out next to=B2$E$1`. Press the shortcut again to switch back.
  2. Trace Precedents. Select a formula cell and choose Formulas > Trace Precedents. Excel draws arrows from the cells the formula uses. If a formula clearly uses a rate but no arrow points to a rate cell, the rate is typed in. Remove Arrows sits right next to it.
  3. Go To Special > Constants. Select a column of results, then Home > Find & Select > Go To Special and choose Constants. Excel selects any cell that holds a typed value instead of a formula. This catches the other kind of hardcoding: a result someone overwrote with a number.
  4. Inconsistent formula warnings. When one formula in a column differs from its neighbours, such as Chloe's =B4*0.04 among =B2*0.045 formulas, Excel's error checking often marks it with a small green triangle. Don't ignore those.

What a job test usually checks#

In a practical Excel test, the person marking your file can easily check for hardcoding: they change an input and see whether every result updates. If you typed 0.04 into your formulas, your answers only work for one scenario.

Things that tend to make a good impression:

  • Inputs in their own labelled cells, separate from calculations.
  • Formulas that point to those cells with $ locks or names.
  • No results typed over formulas, even "just to fix one row".

If the task gives you a rate or a target in a cell, always point to that cell. Typing its value into your formula gets the same number today and fails the moment the reviewer changes it. Our guide to cell references in Excel covers the basics if any of this is new.

Common mistakes with hardcoded numbers#

These are the patterns that cause the most trouble:

  1. Typing the rate into the formula "just for now". It rarely gets fixed later. Make the input cell first.
  2. Forgetting the $ on the input cell. The first row is right and the rest read empty cells and show 0.
  3. Hardcoding a percentage as a whole number. =B2*4 instead of =B2*4% or =B2*0.04 multiplies by 4. In an input cell, type 4% so the value is 0.04.
  4. Pasting a value over one formula. One row now holds a typed number, so it won't update. Use Go To Special > Constants to find it.
  5. Burying adjustments in formulas. =SUM(B2:B5)+250 hides an adjustment nobody can see. Put the 250 in a labelled cell and add that instead.

Our recommendation#

Treat every number in a formula as a question: would anyone ever change this? If the answer is yes, or even maybe, move it to a labelled input cell and point to it with $E$1 or a name. If it's a fixed fact, like 12 months or the 1 in 1+rate, hardcoding it is fine.

Then check your work the way a reviewer would. Change an input and make sure every result moves. Press Ctrl+` and scan for stray numbers. It takes a minute and catches the mistakes that have no error message.

Practise it#

Do the commission exercise on this page, then fill it down in your head: every row should still read E1. To build the habit from the start, try your first formulas, where every formula points to cells rather than typed numbers. Then the relative vs absolute references lesson has you break a tax formula and fix it by locking the rate cell with $.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

The commission rate is in E1, not typed into the formula. In C2, work out Ana's commission as her sales times the rate. Lock the rate cell with $ so the formula still reads E1 when filled down.

fx
ABCDEF
1
Rep
Sales
Commission
Rate
0.04
2
Ana
18400
3
Ben
22150
4
Chloe
9800
5
Dev
31000
6
7
8

Tip: Multiply the sales in B2 by the rate in E1. Press F4 (fn+F4 on a Mac) to turn E1 into $E$1.

Practise this in a lesson

LessonFreeYour first formulasType values, write formulas that start with =, and see how they recalculate.LessonRelative vs absolute references ($)Lock a cell with $ so it doesn't move when you copy a formula, one of the most-tested Excel skills.

Frequently asked questions

What does hardcoded mean in Excel?

+

A hardcoded value is a number typed directly into a formula, such as =B2*0.04, or a typed number sitting where a formula should be. It doesn't update when the assumption behind it changes.

Why is hardcoding bad in Excel?

+

The number is hidden inside the formula, so nobody can see the assumption, and changing it means editing every formula that uses it. Miss one and the sheet gives wrong results with no error message.

Is it ever OK to hardcode numbers in a formula?

+

Yes, for values that are fixed by definition: 12 months in a year, 7 days in a week, 24 hours in a day, or the 1 in =B2*(1+$E$1). If the number is a business assumption that someone might change, give it a cell.

How do I find hardcoded numbers in Excel?

+

Press Ctrl+` (on Windows and Mac) to show formulas instead of results and scan for typed numbers. Trace Precedents on the Formulas tab draws arrows to the cells a formula uses, so a formula with numbers but no arrows deserves a closer look.

Should I use a named range instead of $E$1?

+

A name such as CommissionRate makes formulas easier to read, like =B2*CommissionRate, and it never moves when you fill. Both are much better than a hardcoded number.

Sources

  • Keyboard shortcuts in Excel - Microsoft Support
  • Move or copy a formula in Excel - Microsoft Support

Written and checked by the ExcelReady Team. First published December 1, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. Hardcoded numbers vs cell references at a glance
  2. A side-by-side example: a sales commission sheet
  3. Why the input cell needs a $ sign
  4. When to use cell references (input cells)
  5. When hardcoding is fine
  6. How to find hardcoded numbers in a sheet
  7. What a job test usually checks
  8. Common mistakes with hardcoded numbers
  9. Our recommendation
  10. Practise it

Keep reading

Comparisons· 7 min read

Relative vs Absolute vs Mixed References in Excel

A relative reference like A1 moves when you copy a formula, so each row reads its own cells. An absolute reference like $A$1 never moves, so every copy reads the same cell, such as a tax rate. A mixed reference like $A1 or A$1 locks only the column or only the row, which you need for grids.

Comparisons· 6 min read

Named Ranges vs Cell References in Excel

A cell reference like $F$1 points at a cell by its address; a named range like TaxRate points at the same cell by a name you choose. Names make formulas easier to read and are absolute by default, so they never shift when copied. Plain references are quicker to write, easier to trace and what most job tests expect.

Basics· 5 min read

Mixed References in Excel: $A1 vs A$1 Explained

A mixed reference in Excel locks either the column or the row, but not both. $A1 keeps column A fixed while the row changes as you copy down. A$1 keeps row 1 fixed while the column changes as you copy across. Use mixed references when one formula fills a grid, such as =$A2*B$1 for a multiplication table.

More on comparisons

  • Histogram vs Bar Chart in Excel: The Real Difference
  • HLOOKUP vs XLOOKUP: Horizontal Lookups Compared
  • IFERROR vs IFNA: Which Should You Use?
  • IFERROR vs ISERROR: Which One Should You Use?
  • IFS vs VLOOKUP for Grades and Bands: Which Is Better?
  • INDEX MATCH vs XLOOKUP: Is INDEX MATCH Still Worth Learning?
All comparisons articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free