Sub topic 12
Auditing Flags and Switches
This chapter covers how to review the flag, switch, floor, and cap formulas you built in earlier chapters. It assumes you can copy formulas across a row and use absolute references (such as $C$2). It also assumes you know the layout of a forecast model with periods in columns, and terms such as pre-tax income, tax, cash, and debt balance.
A model with flags and switches can look correct and still be wrong. A flag that is off by one period, a hard-coded 0.25 inside a tax formula, or a scenario number that no one range-checks will not show an error. The model simply gives a plausible wrong number. Auditing is the habit of looking for these quiet failures on purpose.
What an audit is looking for
Most problems with flags and switches fall into four groups.
| Problem | Typical symptom | Where to look |
|---|---|---|
| Inconsistent formulas | One column behaves differently from its neighbors | Across a row of a flag or line item |
| Hard-coded values | Changing an input cell does not change the result | Inside formulas, such as `*0.25` |
| Wrong boundaries | An item starts a period late or ends a period early | The first and last periods of a timing flag |
| Unintended results | Negative tax, debt below zero, repayment above available cash | Rows that use MIN or MAX |
Check 1: one formula per row
A row in a forecast should hold the same formula in every period column. The timing flag from the earlier chapter is a good example:
=IF(AND(F$5>=$C$10,F$5<=$C$11),1,0)The period date is anchored by row (F$5), so it moves as you copy across. The start and end dates are fully anchored ($C$10, $C$11), so they stay fixed. If one column holds a typed 1 or 0 instead of this formula, the flag no longer follows the dates.
To find such breaks:
- Click the first formula cell in the row and press F2 to see its precedents highlighted.
- Press Ctrl+` (grave accent) to show all formulas on the sheet. Scan the row for a cell that looks different.
- In R1C1 notation (File > Options > Formulas > R1C1 reference style), consistent formulas are textually identical across the row. A different one stands out immediately.
- Use Home > Find & Select > Go To Special > Row differences to select cells that differ from the active cell in the same row.
Check 2: no hard-coded numbers in logic
Every assumption should sit in an input cell with a label. Compare these two versions of the bonus formula:
=MIN(F20*0.1,50000)=MIN(F20*$C$3,$C$4)The second version reads the bonus rate from C3 and the maximum from C4. If the cap changes, you edit one labeled cell instead of searching formulas. The same rule applies to the tax rate. Use $C$5, not 0.25.
A quick way to find hard-codes is Go To Special > Constants. It selects every cell that holds a typed number. In a forecast area, constants should appear only where you meant them: in the input block and in the first historical column. A constant in the middle of a calculated row is a defect.
There are two small exceptions that most teams accept: the 0 in MAX(0, ...) and the 1 or 0 results inside an IF flag. These are structural constants, not assumptions.
Check 3: test the boundaries of timing flags
Timing flags fail at their edges. Ask these questions about the start and end dates:
- Is the comparison
>=or>? With>=on the start date, the item is on in the start period. With>, it begins one period later. - Is the end comparison
<=or<? With<=, the item is on in the end period. - What if the start date is after the end date? The AND test never passes, so the flag is 0 in every period. That is safe, but it hides a data-entry mistake.
- What if the start date falls between two period dates? If periods are month-ends and the start is the 10th, the item starts in the following month-end. Decide whether that is acceptable.
A direct test is to set the start and end to the same date. Exactly one period should show a 1. Then set the start to the first model date and the end to the last. Every period should show a 1. Add a check cell that counts the flags:
=SUM(F8:Z8)Compare that sum with the number of periods you expect. A mismatch tells you the boundaries are off.
Check 4: test floors and caps with extreme inputs
MIN and MAX formulas protect against bad values, but only if you confirm that they do. Push an input to an extreme and watch the output.
For tax with a loss floor:
=MAX(0,F30)*$C$5Set pre-tax income in F30 to a negative number. Tax must be exactly zero. If you see a negative tax, the MAX is missing or applied to the wrong term. Note that this formula ignores losses carried forward. If the model needs loss carryforwards, that needs a separate calculation, and an auditor should note it as a simplification.
For debt repayment:
=MIN(F41,MAX(0,F38))Run three tests:
- Set cash available (
F38) to a large positive number, larger than the opening balance (F41). Repayment must equal the opening balance. - Set cash available to a small positive number. Repayment must equal that cash.
- Set cash available to a negative number. Repayment must be zero.
Then confirm the closing balance (opening balance minus repayment) never falls below zero in any of these tests.
Check 5: the scenario switch
A scenario switch drives many rows from one cell:
=CHOOSE($C$2,F10,F11,F12)Audit it for these points:
- Valid values. CHOOSE returns
#VALUE!ifC2is 0, 4, or text. Add data validation toC2(Data > Data Validation > Whole number between 1 and 3) so the cell cannot hold an invalid choice. - Row order. The index must match the order of the rows. If row 10 is base, row 11 is upside, and row 12 is downside, then 1, 2, 3 must mean base, upside, downside. Put a label next to the switch that shows the active name, for example
=CHOOSE($C$2,"Base","Upside","Downside"). - Every driver is switched. Look for an input that should change by scenario but is read directly from one row. The model then mixes scenarios without any warning.
- Same reference everywhere. Every CHOOSE should point to the same switch cell. Use Trace Dependents on
C2to list the cells it feeds. If you expect twelve driver rows and see ten, two are missing.
A review workflow
The diagram shows an order that works well, because the earlier checks make the later ones easier.
Re-run from the start after any fix, because a change in one formula can break a check you already passed.
Add checks inside the model
Manual tests catch problems once. Checks built into the model catch them every time an input changes. Here are three that fit this chapter.
A flag range check confirms every flag holds only 0 or 1:
=IF(SUMPRODUCT((F8:Z8<>0)*(F8:Z8<>1))=0,0,1)A debt check returns 0 when the closing balance is never negative:
=IF(MIN(F45:Z45)<0,1,0)A tax check returns 0 when tax is never negative:
=IF(MIN(F31:Z31)<0,1,0)Each check returns 0 when the model is fine and 1 when it is not. Add them together on a summary cell and show it at the top of the sheet. A total of 0 means all checks pass. Keep the convention the same for every check so that the sum is meaningful.
Common mistakes in audits
- Auditing only the base case. Switch to each scenario and re-run the checks. A debt balance that stays positive in the base case can go negative in the downside case.
- Trusting a flag because the output looks right. A flag that is wrong in a period where the item is small may not change the total visibly. Check the flag row itself.
- Fixing one cell instead of the row. If you correct a single column, you create a new inconsistency. Fix the first cell and copy it across the whole row.
- Replacing a hard-code with a second hard-code. Moving
0.25into a cell that is itself typed in the middle of a calculation block does not help. Inputs belong in one input area with a label and a unit. - Leaving test values behind. After testing with extreme inputs, restore the originals. Keep a note of the original values before you start.
Audit log
Write down what you checked. A short table is enough, and it lets the next reviewer see what was tested.
| Check | Test performed | Result | Fixed? |
|---|---|---|---|
| Timing flag, row 8 | Start equals end date | One period shows 1 | Not needed |
| Tax, row 31 | Pre-tax income set to -100 | Tax is 0 | Not needed |
| Debt repayment, row 42 | Cash set to 0 | Repayment is 0 | Not needed |
| Scenario switch, C2 | Values 1, 2, 3 | All drivers change | Row 12 was not linked, fixed |
Exercise
A timing flag row uses =IF(AND(F$5>=$C$10,F$5<=$C$11),1,0). You set the start date in C10 and the end date in C11 to the same period date, and SUM of the flag row returns 2 instead of 1. Name two likely causes and how you would find each.
Show answer
One cause is a column where the formula was overwritten with a typed 1. Find it with Go To Special > Constants on the flag row, or by showing formulas with Ctrl+` and looking for a cell without a formula. A second cause is that the date row contains the same date twice, for example a copied period header. Find it by comparing the dates in row 5 and checking that each period date is greater than the one before it. A third possibility is that one column uses a different anchoring, such as $F$5, which you would see by comparing formulas in R1C1 style.
Exercise
A debt repayment cell uses =MIN(F41,MAX(0,F38)). You test it with F38 = -500 and F41 = 1,000. What should the result be, and what does a result of -500 tell you about the formula?
Show answer
The result should be 0, because MAX(0,-500) is 0 and MIN(1000,0) is 0. A result of -500 means the MAX was left out, so the formula is =MIN(F41,F38). With that version, negative cash produces a negative repayment, which would increase the debt balance.
Exercise
Your scenario switch in C2 feeds CHOOSE formulas for 12 driver rows. Trace Dependents on C2 shows only 11 rows. What do you do next, and why is the error hard to notice from the outputs alone?
Show answer
Find the driver row that is not linked, by comparing the list of driver rows with the dependents of C2. Replace its direct reference with a CHOOSE formula that uses $C$2 and the base, upside, and downside rows. The error is hard to see because the unlinked row keeps a fixed value in every scenario. The outputs still change when you switch scenarios, so the model looks as if it works, but it mixes one fixed driver with the other scenario values.