Sub topic 6
One formula per row across the time axis
This chapter assumes you can write basic spreadsheet formulas, know the difference between relative and absolute references, and understand growth rates and periods. It covers the calculations layer's most important rule: each row holds one formula, copied across every period.
Why one formula per row
A model's time axis runs across the columns. Each column is a period such as a month, quarter, or year. Each row is a line item such as revenue or gross profit.
The rule is simple. Within a row, every cell in the calculation range uses the same formula. You write it once and copy it across. When you click any cell in the row, the formula reads the same way, relative to its own column.
This matters for three reasons.
- Auditing is fast. A reviewer checks one cell and knows the whole row is right.
- Changes are safe. You edit one cell and copy it across, so no period is left behind.
- Errors stand out. If one cell differs, it is almost certainly a mistake.
A row that breaks the rule is a hidden error waiting to happen. A typed number in the middle of a formula row will not update when an input changes, and nothing on screen warns you.
What a consistent row looks like
In the spreadsheet example, revenue for each year grows from the prior year using the growth input.
Inputs!C5 = 0.10 (growth rate, blue input cell)
Calc!E10 = D10*(1+Inputs!$C$5) (revenue, same formula copied across every year column)
Calc!E12 = E10*(1-Inputs!$C$6) (gross profit, where Inputs!C6 is the COGS percentage)Look at the references in Calc!E10:
D10is relative. When you copy the formula to column F, it becomesE10, which is the prior period. This is what makes the row consistent.Inputs!$C$5is absolute. It stays fixed when copied, because the growth rate is a single input and does not move with the time axis.
The pattern is: relative references for things that move with time, absolute references for things that do not.
The first-period problem
The formula above works from column E onward. Column D has no prior column to grow from, so it needs a starting value. This is the most common reason people break the rule.
There are three clean solutions.
- Use a flag row. Create a row of 1s and 0s, such as
first_period_flag, that is 1 only in the first period. Then one formula handles every column. - Use an opening-balance column. Put the starting value in a separate column to the left, then let every period column reference it.
- Use a time-aware lookup. Pick the starting value with
IFon a period counter row.
Here is the flag approach for revenue:
Calc!D6 = IF(D$5=1, Inputs!$C$4, C10*(1+Inputs!$C$5))Here D$5 is a period counter row (1, 2, 3, and so on). The first period pulls the year-one revenue input. Every later period grows from the one before. The same formula sits in every column.
Notice that the first column of the range refers to column C, which is a label or blank column. The IF never evaluates that branch in period 1, so this is safe. Keep the cell to the left of the first period free of text if your formula might read it in other contexts.
The Python example in the spine does the same thing with an if year > 1: check inside the loop. One loop body handles all years, and the special case is explicit.
Mixing time and constants
A consistent formula cannot contain typed constants. Compare these two versions of a tax row.
Bad: =MAX(E15,0)*0.25
Good: =MAX(E15,0)*Inputs!$C$8The bad version hides the 25% rate inside a formula. If the rate changes, someone must hunt through every row. The good version points at one input. Chapter content on input hygiene covers this in more detail. Here the point is that a hardcode inside a row formula is both a layer violation and a consistency risk.
Time-varying assumptions
Sometimes an assumption changes by period. Growth might be 12% in year 1, 10% in year 2, and 8% in year 3. You do not solve this by writing different formulas per column. You change the input.
Put the assumption on the inputs sheet as its own row, with one value per period, laid out on the same time axis as the calculations.
Inputs!E5:G5 = 12%, 10%, 8% (growth rate by year, blue input cells)
Calc!E10 = D10*(1+Inputs!E5) (revenue, same formula in every column)Now the formula reference is relative in both rows, and column E in the calculation sheet lines up with column E on the inputs sheet. The formula is still identical across the row. The variation lives in the data, not the logic.
This is why a consistent column layout across sheets helps. If every sheet uses column E for year 1, you can read across sheets without translating.
Handling events that happen once
Some items occur in a single period, such as a capital expenditure in year 3 or a loan drawdown in year 2. Do not type a number into one cell of a row. Use a timing flag.
Inputs!C12 = 3 (capex year)
Inputs!C13 = 500000 (capex amount)
Calc!E30 = IF(E$5=Inputs!$C$12, Inputs!$C$13, 0)The same formula runs in every column. It returns the amount when the period counter matches the input year, and zero otherwise. To move the spend to year 2, change one input.
How to check for inconsistencies
You should not rely on your eyes alone. Excel offers several ways to test a row.
- Ctrl+\ (Windows) or Ctrl+backslash: select a row range and press it. Excel selects the cells whose formula differs from the active cell's, in relative terms.
- Show Formulas (Ctrl+`): displays formulas rather than values, so you can scan across.
- R1C1 reference style: in this style, a consistent row shows the identical formula text in each cell, which makes differences obvious.
- Go To Special, then Constants: finds typed numbers among formulas.
You can also build a check. For example, =SUMPRODUCT(--ISFORMULA(E10:G10)) counts how many cells in a row contain formulas. If the result is lower than the number of periods, a cell has been overwritten with a number. Feed this into your integrity checks, which a later chapter covers.
The same consistency applies in code. A Python version should handle every period in one loop body, with no hand-edited values.
growth_by_year = [0.12, 0.10, 0.08]
revenue = [1_000_000]
for g in growth_by_year:
revenue.append(revenue[-1] * (1 + g))
print([round(r) for r in revenue])The growth rates vary, but the formula in the loop does not.
Common errors
| Error | Symptom | Fix |
|---|---|---|
| Hardcoded number pasted over a formula | The cell ignores input changes | Restore the formula and copy it across |
| Different formula in the first column | A row has two logics | Use a flag or opening-balance column |
| Missing `$` on an input reference | Input reference drifts when copied | Anchor with `$C$5` |
| Extra `$` on a time reference | Every period uses the same prior value | Remove the anchor from the time reference |
| Formula changed in one column only | Result is right today, wrong after an edit | Re-copy the formula across the row |
| Time axis columns differ across sheets | References are offset by one period | Align every sheet to the same columns |
A short workflow
- Write the formula in the first period column.
- Check which references should move and which should stay fixed.
- Copy the formula across the full time range.
- Select the row and run Go To Special to find any cells that differ.
- Change an input and confirm every period in the row responds.
The last step is a quick sensitivity test. If a period stays frozen, you have a hardcode.
Exercise
A row computes interest expense as =D20*0.06 in column E, and the cell in column G contains the typed number 31200. Name the two problems and describe how to repair the row.
Show answer
The first problem is the hardcoded rate 0.06 inside the formula. Move it to an input cell and reference it as Inputs!$C$9. The second problem is the typed value in column G, which breaks the one-formula-per-row rule and will not respond to input changes. Replace it with the same formula as the other columns, then copy the corrected formula across the whole row so every period matches.
Exercise
Capex of 500,000 occurs in year 3 only, and the period counter is in row 5. Write one formula that works in every column.
Show answer
=IF(E$5=Inputs!$C$12, Inputs!$C$13, 0), where Inputs!C12 holds the capex year (3) and Inputs!C13 holds the amount. The row reference on the counter is anchored with $ and the column is relative, so the formula copies across correctly.