All articles

Formula deep-dive

How to Detect Hardcoded Values in Excel Formulas

May 14, 20262 min read

How to Detect Hardcoded Values in Excel Formulas

Hardcoded values are numbers typed directly inside formulas instead of being linked to an input or assumption cell.

They are common in Excel workbooks, but they can create serious risk because important assumptions become hidden inside calculations.

What is a hardcoded value?

A hardcoded value is a fixed number inside a formula.

Example:

=B10*1.15

The value 1.15 may represent tax, markup, inflation, price increase, or another assumption. But unless the formula is documented, another user may not know what it means.

Why hardcoded values are risky

Hardcoded values can cause problems because:

  • assumptions are hidden
  • formulas become harder to review
  • updates may be missed
  • different cells may use different assumptions
  • the workbook becomes harder to audit
  • errors are difficult to trace.

In finance, accounting, pricing, and forecasting models, hardcoded assumptions can materially change results.

Examples of hardcoded values

Common examples include:

=Sales*0.25
=Revenue*1.10
=Cost/1.18
=Units*12
=Amount*(1+0.05)

Some values may be harmless, such as 0, 1, or 2 in simple logic formulas. The risk depends on context.

How to find hardcoded values manually

You can use Excel’s Find function to search formulas, but this can be slow.

A practical manual approach is:

  • Show formulas using Ctrl + ~.
  • Review calculation columns.
  • Look for numbers inside formulas.
  • Focus on percentages, multipliers, and rates.
  • Check whether the value should be an input assumption.

Better practice: use assumption cells

Instead of this:

=B10*1.15

Use this:

=B10*$E$2

Where E2 clearly contains the assumption, such as:

VAT rate = 1.15

This makes the workbook easier to review and update.

Not every hardcode is bad

Some hardcoded values are normal. For example:

=IF(A1="",0,A1)
=ROUND(B1,2)
=MONTH(A1)

The goal is not to eliminate every number inside every formula. The goal is to identify hidden assumptions that may affect the result.

Conclusion

Hardcoded values are one of the most important spreadsheet risks because they hide business logic inside formulas.

SaferSheets helps detect formulas that contain hardcoded numbers and flags the ones that may need review.

Run an audit on your workbook

SaferSheets automates everything in this article. Upload your spreadsheet, get a ranked list of every issue in under a minute.

Audit a workbook free

Free tier — 30 audits a month — no card required.

How to Detect Hardcoded Values in Excel Formulas