Sub topic 10
Timelines and Flags That Every Calculation Shares
This chapter assumes you can build multi-sheet workbooks, use absolute and relative references, and know IF, AND, SUM and EOMONTH. It covers how one timeline and a small set of flags keep every calculation sheet consistent. This is the Structured principle from FAST in practice.
Why share one timeline
A model that calculates over time needs to know which period each column represents. If every sheet builds its own dates, or if one calculation hardcodes "operations start in column K", the model breaks when an input changes. A shared timeline removes that risk. It is built once and every sheet refers to it.
Two rules apply:
- Same column, same period. Column F is the same period on every calculation sheet. Cross-sheet links then stay in the same column, and a reviewer can check them by eye.
- Timing logic lives in the timeline. Dates and on/off switches are calculated in the timeline block. Calculation rows only multiply by the result.
The timeline block
Put the timeline at the top of each calculation sheet, linked to a master timeline, or on a dedicated sheet. A typical block looks like this:
| Row | Content | Type |
|---|---|---|
| 5 | Period counter | Number: 1, 2, 3... |
| 6 | Period start date | Date |
| 7 | Period end date | Date |
| 9 | First-period flag | 1 or 0 |
| 10 | Operations flag | 1 or 0 |
The formulas below are identical across the row. Column E is left empty so that the first column can refer to it without a special case. Inputs!D6 holds the model start date, which must be the first day of a month.
F5: =E5+1
F9: =IF(F$5=1,1,0)
F6: =IF(F$9=1,Inputs!$D$6,E7+1)
F7: =EOMONTH(F6,0)The first-period flag lets the start date row use one formula in every column. The first period takes the start date from the inputs. Every later period starts the day after the previous one ends.
Flags
A flag is a row that holds 1 when a condition is true and 0 when it is not. Use numbers rather than TRUE and FALSE, because numbers can be multiplied and summed directly.
The operations flag switches a calculation on only while operations run. The start and end dates stay on the Inputs sheet:
F10: =IF(AND(F$6>=Inputs!$D$8,F$7<=Inputs!$D$9),1,0)Row 6 is the period start date, row 7 is the period end date, Inputs!D8 is the operations start date and Inputs!D9 is the operations end date. The flag is 1 only when the whole period falls inside the operating window.
Now the revenue calculation needs no date logic:
F22: =F20*F21*F$10Row 20 is units sold, row 21 is price per unit and row 22 is revenue. If the operations start date moves, the flag row changes and every calculation that uses it follows.
Flags in balances
The first-period flag has a second use. A balance sheet item needs an opening balance in period 1, but in later periods the opening balance is the previous closing balance. Instead of typing a different formula in the first column, add the opening input only when the flag is 1:
F28: =E31+F$9*Inputs!$D$12
F29: =F27
F30: =-F26
F31: =SUM(F28:F30)Row 9 is the first-period flag, row 26 holds repayments as a positive number, row 27 holds additions, row 28 is the opening balance, rows 29 and 30 are additions and repayments and row 31 is the closing balance. Column E must be empty or zero for this to work. Because F30 changes the sign of the repayments, the closing balance is a plain SUM.
Design rules for flags
- One flag, one meaning. Do not reuse the operations flag as a "construction finished" flag. Create a second flag.
- Name it by what it signals. Use labels such as "Operations flag" or "Last-period flag". Avoid "Flag 1".
- Build it once. Calculation sheets link to the flag or the master timeline. They do not rebuild it with their own
IFtests on dates. - Absolute references to inputs, mixed references to the timeline.
F$6locks the row so the formula copies down safely.Inputs!$D$8locks both row and column because the input is a single cell. - Multiply, don't nest.
=F20*F21*F$10is easier to read than=IF(F$10=1,F20*F21,0). Multiplication also stays correct if a flag later becomes a fraction.
Edge cases
Partial periods. The flag above is 0 in a period that is only partly inside the operating window. If operations start on 15 January in a monthly model, January gets no revenue. Choose one of two fixes and document it:
- Use an overlap test,
AND(F$7>=start,F$6<=end), which flags any period that touches the window. This gives a full month of revenue for a half month of operations. - Calculate the fraction of the period that is active and multiply by it:
F11: =MAX(0,MIN(F$7,Inputs!$D$9)-MAX(F$6,Inputs!$D$8)+1)/(F$7-F$6+1)This returns a number between 0 and 1 and works for start dates in the middle of a period.
End before start. If a user enters an operations end date before the start date, the flag row is all zeros and the model looks empty without any error. Add an integrity check on the inputs, covered in the chapter on integrity checks.
Days in period. Do not hardcode 30 or 365. Use =F7-F6+1 in its own row and refer to it. It handles leap years and different period lengths.
Changing the period length. If the model may move between monthly and annual periods, make the end date formula depend on an input, for example EOMONTH(F6,Inputs!$D$5-1) where D5 is the number of months per period. Then no calculation row needs to change.
Last period. A last-period flag, built like the first-period flag, supports terminal values and final repayments without special formulas in the final column.
Exercise
A model has monthly columns. Row 6 holds period start dates and row 7 holds period end dates. Construction runs from the date in Inputs!D4 to the date in Inputs!D5. Write the flag formula for F12 that is 1 only for periods that fall entirely within construction. Then write the formula for a cost in F30 that multiplies a monthly cost in F29 by that flag.
Show answer
F12: =IF(AND(F$6>=Inputs!$D$4,F$7<=Inputs!$D$5),1,0). F30: =F29*F$12. The flag holds the date logic, so the cost row has no IF and the same formula works in every column.