Sub topic 4
Timing Flags: Switching Items On and Off by Period
This chapter assumes you know cell references, relative and absolute references, and how to copy formulas across a row. You should also be familiar with a forecast laid out with time periods in columns.
What a timing flag does
A timing flag is a control formula that returns 1 when an event applies in a period and 0 when it does not. The flag separates timing logic from the amount being calculated.
For example, a capital project might begin in January and end in June. The project cost should appear only in those months. Instead of changing each month manually, you can create one flag and copy it across the forecast.
A 1/0 flag is useful because it behaves like a switch:
- 1 means on, or include the item.
- 0 means off, or exclude the item.
The period dates must be consistent. If the timeline contains month-end dates, the start and end dates should use the same convention.
Build a flag from start and end dates
Assume the following layout:
| Location | Meaning | Example |
|---|---|---|
| Row 5 | Forecast period dates | January 31, February 28, March 31 |
| C10 | Activity start date | January 31 |
| C11 | Activity end date | June 30 |
| Row 8 | Timing flag | Formula copied across the forecast |
In cell F8, enter this formula:
=IF(AND(F$5>=$C$10,F$5<=$C$11),1,0)The formula checks two conditions:
- The period date in F5 is on or after the start date in C10.
- The period date in F5 is on or before the end date in C11.
AND returns TRUE only when both conditions are true. IF then converts TRUE to 1 and FALSE to 0.
The dollar signs control how the formula copies:
- F$5 allows the column to move to G, H, and later periods while keeping row 5 fixed.
- $C$10 and $C$11 keep both the column and row fixed.
- Copying the formula across the timeline makes each column test its own period date against the same start and end dates.
The flag is inclusive. A period equal to the start date or end date returns 1.
Use the flag to control a line item
Suppose row 20 contains the monthly project cost, and row 8 contains the timing flag. In F21, calculate the active cost as follows:
=F20*F$8When the flag is 1, the cost passes through unchanged. When the flag is 0, the result is zero. This design keeps the underlying cost assumption visible while making the timing rule easy to audit.
You can also use the flag for revenue, depreciation, headcount, financing fees, or any other item that applies only during a defined period.
Common errors
Dates stored as text
A date that looks correct may actually be text. Comparisons can then return unexpected results. Check that the start date, end date, and timeline dates are stored as spreadsheet dates.
Incorrect anchoring
If you write F5 instead of F$5, copying the formula down may change the row reference. If you write C10 instead of $C$10, copying across may shift the input column.
Reversed dates
If the end date comes before the start date, every period returns 0. Add a visible check if users can change these inputs.
Overlapping activities
Two projects may be active in the same period. That may be correct, but check whether the model expects both costs or requires a separate allocation rule.
Audit the timing logic
Review a flag by testing boundary periods:
- One period before the start date should return 0.
- The start period should return 1.
- A period in the middle should return 1.
- The end period should return 1.
- One period after the end date should return 0.
Also check whether every copied formula uses the same structure. A single hard-coded 1 or 0 can hide a timing error when the dates change.
Exercise
The start date is March 31 and the end date is June 30. What should the timing flag return for February 28, March 31, June 30, and July 31?
Show answer
It should return 0, 1, 1, and 0, respectively, because the start and end dates are included.