Sub topic 12
Managing inputs and removing hardcodes from formulas
This chapter assumes you can build multi-sheet Excel workbooks, use relative and absolute references, and read the standard functions (IF, SUM, AND, ABS). It also assumes you know the layout from the previous chapters: inputs, calculations and outputs on separate sheets, with a shared timeline.
Why inputs need management
An input is any value a person chooses or sources from outside the model. Examples are a price, a tax rate, a start date or an opening balance. A hardcode is an input typed directly into a formula, such as =F20*1.2. The 1.2 is hidden from anyone reading the sheet.
Hardcodes cause three problems:
- A reviewer cannot see the assumption without opening the cell.
- Changing the assumption means finding every cell that contains it. You will miss one.
- Scenarios cannot run, because the value is not in a place a scenario can overwrite.
The FAST Standard links this chapter to two principles. A model is Flexible when you can change an assumption in one place and have the change flow everywhere. It is Transparent when a reader can see every assumption that drives a result.
The rule: one input, one cell
Every input lives in exactly one cell on the inputs sheet. Calculations refer to that cell and never retype the value. Each input has:
- A label that says what it is.
- A unit, such as %, USD, months or a date.
- The value itself, formatted as an input (see the conventions chapter).
- Optionally, a source or note.
A minimal inputs layout looks like this:
| Row | Label | Unit | Value (column D) |
|---|---|---|---|
| 8 | Operations start date | date | 01-Jan-2027 |
| 9 | Operations end date | date | 31-Dec-2036 |
| 10 | Price per unit | USD | 25.00 |
| 11 | Tax rate | % | 25% |
| 12 | Opening loan balance | USD | 500,000 |
What counts as a hardcode
Some hardcodes are obvious. Others are easy to overlook.
- Embedded numbers:
=F20*1.2or=F22*0.25for tax. - Embedded dates:
=IF(F$6>=DATE(2027,1,1),1,0). - Overwritten formulas: one cell in a row of formulas replaced with a typed number. This is the most dangerous kind, because it looks like the rest of the row.
- Text in formulas:
=IF(F5="Base",...)where "Base" is typed rather than referenced. - Pasted values: results of an earlier calculation pasted over a live one.
Not every constant is a hardcode. Unit conversions that never change are generally acceptable, such as 12 months in a year, 1000 for thousands, or 0 and 1 in flags. Even so, many teams put them in a constants area on the inputs sheet so that nothing numeric appears in a formula. Choose one policy and apply it everywhere.
Worked example: removing a hardcode
Here is revenue after tax, written badly. Row 20 is units sold and row 21 is price per unit.
F23: =F20*F21*(1-0.25)The tax rate is buried in the formula. To fix it, add the rate to the inputs sheet and split the calculation into one step per row.
F22: =F20*F21
F23: =F22*Inputs!$D$11
F24: =F22-F23
' Row 22: Revenue
' Row 23: Tax
' Row 24: Revenue after tax
' Inputs!D11: Tax rate (25%)Three things changed. The rate is now visible and changeable in one place. Each row performs one calculation. The $D$11 reference is absolute, so copying the formula across columns always points to the same input.
Using inputs for dates and first-period values
Inputs also remove special cases from the timeline. The flag formula from the previous chapter reads its dates from the inputs sheet.
F10: =IF(AND(F$6>=Inputs!$D$8,F$7<=Inputs!$D$9),1,0)
' Row 6: Period start date
' Row 7: Period end date
' Inputs!D8: Operations start date
' Inputs!D9: Operations end dateThe same applies to opening balances. A common mistake is to type the opening balance into the first column of the balance row, which makes that column's formula different from the rest. Instead, use a first-period flag and an input.
F28: =E31+F$9*Inputs!$D$12
F29: =F27
F30: =-F26
F31: =SUM(F28:F30)
' Row 9: First-period flag (1 in the first period, 0 otherwise)
' Row 26: Repayments (positive number)
' Row 27: Additions
' Row 28: Opening balance
' Row 29: Additions
' Row 30: Repayments
' Row 31: Closing balanceIn the first period, E31 is blank or zero, and the flag adds the opening balance. In every later period the flag is 0, so the input has no effect. All columns use one formula.
Time-varying inputs
Some inputs change over time, such as a price that rises each year. Do not type the numbers into the calculation sheet. There are two sound options:
- Input row on the inputs sheet, laid out on the same timeline as the calculations. The calculation reads the cell in the same column, so the formula stays consistent.
- A single input plus a calculation, such as a base price and an annual escalation rate. The calculation row applies the escalation, and the inputs stay as two cells.
Option 2 is usually easier to review and to run scenarios on. Option 1 is better when the values come from an external forecast and have no simple pattern.
Scenarios and selectors
When you want to run several cases, avoid copying the inputs sheet. Put the scenario values side by side and use a selector cell that picks the live case.
Inputs!D10: =CHOOSE($D$4,F10,G10,H10)
' D4: Scenario number (1 = Base, 2 = Upside, 3 = Downside)
' F10:H10: Price per unit for each scenarioINDEX is an alternative to CHOOSE and scales better when there are many cases. Whichever you use, the live value is a calculated cell and should be formatted as a calculation, not as an input. Validate the selector with a data validation list so that nobody can enter 4 when only three scenarios exist.
Protecting inputs from bad entries
Good input management also limits what can go wrong at entry:
- Use data validation for dates, percentages between 0 and 100%, and whole numbers.
- Use named ranges only if your team's standard allows them. Names can make formulas shorter but hide where a value lives, so many standards discourage them.
- Keep inputs together. A scattering of input cells across calculation sheets defeats the one-place rule.
- Never put a formula in an input cell. If a value is derived, move it to the calculation sheet.
Common errors
| Error | Why it hurts | Fix |
|---|---|---|
| Number typed inside a formula | Hidden assumption, easy to miss on update | Move to inputs and reference it |
| Typed value overwrites one cell in a row | The row looks consistent but is not | Restore the formula, add a check |
| Same assumption typed in two places | The copies drift apart | Keep one cell, point to it |
| Opening balance typed in first column | First column formula differs | Use first-period flag and input |
| Relative reference to an input | Copying across shifts the reference | Anchor with `$` |
| Formula inside an input cell | Reader cannot tell what is a choice | Move the derivation to calculations |
Finding hardcodes in an existing model
You can check for hardcodes without reading every cell.
- Use Go To Special and select Constants on a calculation sheet. Any number it finds there is a candidate hardcode.
- Use Formulas with only the Numbers option ticked to find cells that contain formulas returning numbers. Compare with the Constants selection to spot cells that break a pattern.
- Press Ctrl+` to show formulas and scan for digits inside them.
- Compare formulas across a row with Go To Special, Row Differences, to spot overwritten cells.
Connecting to integrity checks
Input management and checks work together. An overwritten cell will often break a total, and the balance check in the next chapters will flag it. You can also add input checks that confirm dates are in order and percentages are in range:
D14: =IF(Inputs!D9>Inputs!D8,0,1)
' D8: Operations start date
' D9: Operations end date
' D14: Date order flag (0 = pass, 1 = fail)Feed these flags into the same summary cell as the other checks, so the model reports one overall status.
Exercises
Exercise
A calculation row contains =F30*0.19+F31*0.19. List two problems with this formula and describe how you would restructure it.
Show answer
The tax rate of 0.19 is hardcoded, and it is typed twice, so the copies can drift apart. Add the rate to the inputs sheet as one cell, for example Inputs!$D$15. Then calculate a taxable base on one row (=F30+F31) and a tax row (=F32*Inputs!$D$15). The rate is visible, appears once, and each row performs one calculation.
Exercise
The opening balance of 250,000 is typed into the first column of the closing balance row, and later columns use =E31+F27-F26. Which principle does this break, and what is the fix?
Show answer
It breaks formula consistency across the row, and it hides an input in the calculation. Place 250,000 on the inputs sheet. Add a first-period flag row that is 1 in the first period and 0 otherwise. Use =E31+F$9*Inputs!$D$12 in the opening balance row for every column, then calculate closing balance with the same formula in every column.
Exercise
You select Constants with Go To Special on a calculation sheet and Excel highlights a number in the middle of a row of formulas. What has probably happened, and what do you do?
Show answer
A formula was overwritten with a typed or pasted value. Compare with the neighbouring cells, restore the row's formula by copying it from an adjacent cell, and check whether any output changed. Then consider adding a check row so the same problem is flagged automatically in future.