Sub topic 12
Auditing Flags and Switches
This chapter assumes you know cell references, anchored references, and how to copy formulas across a forecast. You should also recognize revenue, pre-tax income, tax, cash, and debt in a simple financial model.
Flags and switches control model behavior. A flag usually contains 1 or 0. A 1 includes an item, while a 0 excludes it. A switch is one control cell that selects among alternatives, such as base, upside, and downside cases.
These controls make a model easier to change. However, a flag can be wrong in every period, and a switch can point to the wrong scenario. Auditing means checking both the formula and the result.
Check the control cells first
Begin with the cells that drive behavior.
- Confirm that a flag is intended to contain only
1or0. - Check that a switch uses the documented values, such as
1,2, and3. - Add a clear label beside each control cell.
- Use data validation where appropriate so users cannot enter an invalid option.
- Keep assumptions in input cells instead of embedding them in formulas.
For example, a timing flag should refer to the period date and the stated start and end dates:
=IF(AND(F$5>=$C$10,F$5<=$C$11),1,0)The formula should return 1 for every period from the start date through the end date. Check the boundary periods carefully. A formula using > instead of >= excludes the start period.
Compare formulas across periods
A copied formula should normally have the same structure in every period. Relative references should move, and anchored references should stay fixed.
Suppose the first period contains:
=F20*F$8The next period should usually contain:
=G20*G$8The row for the line item and the row for the flag remain fixed, while the period column changes. A reference such as $F$8 would keep pointing to the first period and could silently make every later period use the same flag.
A practical review compares the first, middle, and last forecast columns. Look for:
- A missing
$anchor. - A formula that was not copied into one period.
- A hard-coded
0or1. - A reference to the wrong row.
- Different formulas in periods that should behave consistently.
Test combinations of flags
A formula may work when one condition is true but fail when conditions interact. Test each important combination.
For example, a line item may be active only when a project is open and funding is approved:
=IF(AND(F$8=1,F$9=1),F20,0)If either flag is 0, the result should be zero. Multiplication can express the same rule when the controls are guaranteed to be numeric flags:
=F20*F$8*F$9Use OR when one of several conditions is enough. For instance, an expense may apply if either a launch flag or a renewal flag is active:
=IF(OR(F$8=1,F$9=1),F20,0)Test the all-zero case, the all-one case, and mixed cases. These tests reveal accidental inclusion caused by an inverted condition.
Audit floors, caps, and switches
MIN and MAX often hide conditional logic. Confirm the order and meaning of their arguments.
A tax floor should never produce a tax benefit from a loss:
=MAX(0,F30)*$C$5Check a positive income case, a zero-income case, and a loss case. The loss case should return zero tax.
A debt sweep should not repay more than available cash or the opening debt balance:
=MIN(F41,MAX(0,F38))Check whether negative cash produces zero repayment. Then check whether excess cash repays only the remaining balance. If the result exceeds either limit, inspect the referenced rows and signs.
A scenario switch should have a visible mapping:
=CHOOSE($C$2,F10,F11,F12)Here, 1 selects the base row, 2 selects the upside row, and 3 selects the downside row. Verify that the labels and row order match. A switch can be mathematically valid while selecting the wrong business case.
Use an audit checklist
| Check | Question |
|---|---|
| Inputs | Are start dates, rates, limits, and scenario values in input cells? |
| Structure | Do copied formulas keep the intended relative and anchored references? |
| Range | Do timing flags include the correct start and end periods? |
| Limits | Do floors and caps hold under positive, zero, and negative cases? |
| Switches | Does each switch value select the documented scenario? |
Exercise
A debt repayment formula is =MIN(F41,MAX(0,F38)). Opening debt is 100, available cash is -20, and the formula returns 0. Is that result correct, and which part of the formula creates it?
Show answer
Yes. MAX(0,F38) changes the negative cash amount to 0, and MIN(F41,0) limits repayment to 0.