Sub topic 11
A Scenario Switch with CHOOSE
This chapter assumes you can anchor references with $, copy a formula across a row of periods, and read a simple forecast layout. It also assumes you have used IF to build a 1/0 flag, as covered earlier in this tutorial. Here you will build a scenario switch: one control cell that selects base, upside, or downside assumptions for the whole model.
Why one control cell
A forecast usually needs to answer "what if?" questions. What happens to cash if growth is 8% instead of 5%? What if costs rise faster?
The weak way to answer is to overwrite the growth input, look at the result, and type the old number back. This loses the original assumption and leaves no record of what you tested. It also makes it easy to forget a changed cell and send out the wrong numbers.
A scenario switch avoids this. You store every scenario's assumptions side by side, permanently. A single cell holds the number of the scenario you want. Formulas read that cell and pick the matching assumption. Changing the scenario means changing one cell, and every input that depends on it updates together.
The CHOOSE function is a good fit for this job.
How CHOOSE works
CHOOSE takes an index number followed by a list of values. It returns the value at the position the index names.
=CHOOSE(index_num, value1, value2, value3, ...)With an index of 1 it returns value1, with 2 it returns value2, and so on. The values can be numbers, text, or cell references. In a model they are almost always cell references.
The formula from our layout is:
=CHOOSE($C$2,F10,F11,F12)Cell C2 is the switch. It holds 1, 2, or 3. Row 10 holds the base value, row 11 the upside value, and row 12 the downside value. The $C$2 reference is anchored so it keeps pointing at the switch when you copy the formula across periods. F10, F11, and F12 are not anchored, so they shift to G10, G11, and G12 as the formula moves right.
What CHOOSE does with bad input
CHOOSE is strict, and that is useful. Check each case before relying on it:
| Value in the switch cell | Result |
|---|---|
| 1, 2, or 3 | The matching value |
| 2.9 | Treated as 2, because `CHOOSE` truncates decimals |
| 0 or a blank cell | `#VALUE!` |
| 4 (more than the number of values) | `#VALUE!` |
| Text that is not a number | `#VALUE!` |
The truncation of 2.9 to 2 is the one that can mislead you. The other cases produce a visible error, which is what you want. A model that shows an error when the switch is wrong is safer than one that quietly returns a plausible number.
A worked example: revenue growth by scenario
The example below shows how a switch drives a forecast. Column C holds single-value inputs, and columns F to J hold five forecast years.
| Row | Label | Contents |
|---|---|---|
| 2 | Scenario switch | `C2` holds 1, 2, or 3 |
| 3 | Scenario name | `C3` shows the selected name |
| 10 | Growth: Base | 5% in each of F10 to J10 |
| 11 | Growth: Upside | 8% in each of F11 to J11 |
| 12 | Growth: Downside | 2% in each of F12 to J12 |
| 13 | Growth: Live | The selected scenario |
| 15 | Revenue | Last year's revenue grown at the live rate |
Row 13 is the live row. It is the only row the rest of the model reads. Put this formula in F13 and copy it across to J13:
=CHOOSE($C$2,F10,F11,F12)Revenue in F15 then uses the live row. Assume E15 holds last year's actual revenue:
=E15*(1+F13)With C2 set to 1, F13 returns 5%. Set it to 2 and F13 returns 8%. Set it to 3 and it returns 2%. Revenue, and everything downstream of it, recalculates.
The rule behind this layout is that nothing outside the scenario block should point at rows 10 to 12. Only the live row does. If a revenue formula referenced F11 directly, it would ignore the switch and mix scenarios without any warning.
Show the scenario name
A bare number in C2 tells the reader little. Add a label cell that uses CHOOSE with text:
=CHOOSE($C$2,"Base","Upside","Downside")Place this in C3, and link it to the headers of your output pages. Anyone who prints a page can then see which scenario produced it. Keep the order of the names identical to the order of the value rows. If the two orders drift apart, the label will describe a scenario that is not the one running.
Several inputs, one switch
A real model has more than one scenario-driven input, such as growth, margin, and capital spending. Give each input its own block of three rows and its own live row. Every live row uses the same $C$2:
=CHOOSE($C$2,F20,F21,F22)
=CHOOSE($C$2,F25,F26,F27)
=CHOOSE($C$2,F30,F31,F32)Each formula points at a different block, but all three read one switch. That shared reference is the point of the design. If two live rows used two different switch cells, you could run a base-case growth rate with a downside margin without meaning to.
CHOOSE compared with IF and INDEX
You can build the same switch with other functions. Knowing the trade-offs helps you choose.
Nested IF:
=IF($C$2=1,F10,IF($C$2=2,F11,F12))This works, but it grows by one IF for every extra scenario and gets hard to read at five or six. It also has a hidden flaw. Any value of C2 that is not 1 or 2, including 0, 7, or a typo, falls through to the final branch and returns the downside. The model keeps running without any sign that the switch is wrong. IF suits a two-way switch, where a single 1/0 cell chooses between two options. For three or more scenarios, CHOOSE is easier to read and fails loudly.
INDEX:
=INDEX(F10:F12,$C$2)This is shorter and scales well, but it only works when the scenario rows sit next to each other in order. An index of 0 returns the whole range instead of an error, and an index above 3 returns #REF!. INDEX is a sound choice for large scenario tables. For a model with a few inputs, CHOOSE shows each option in the formula, so a reviewer can read exactly what it does.
Protecting the switch
A switch only helps if the person using it cannot easily break it. Three habits cover most of the risk.
- Restrict what can be typed. Apply data validation to
C2. Use a list that allows only 1, 2, and 3, or a whole number between 1 and 3. This stops 0, 4, and 2.9 at entry. - Add a check cell. Validation can be bypassed by pasting over the cell, so test the switch too. This formula returns 0 when the switch is valid and 1 when it is not:
=IF(AND($C$2>=1,$C$2<=3,$C$2=INT($C$2)),0,1)Add this to your model's overall check total. The INT comparison catches 2.9, which CHOOSE would otherwise accept and truncate.
- Format the switch cell as an input. Use the same input colour and style as the rest of your model, and add a short note beside it, such as "1 = Base, 2 = Upside, 3 = Downside".
Common errors
- Hard-coding a value inside CHOOSE. Writing
=CHOOSE($C$2,0.05,0.08,0.02)buries assumptions in a formula, where nobody will review or change them. Put the values in cells and reference the cells. - Forgetting to anchor the switch. Writing
C2instead of$C$2works in the first column and then points atD2,E2, and so on after you copy it across. Those cells are empty, so the formula returns#VALUE!from the second period on. - Anchoring the value references. Writing
$F$10,$F$11,$F$12makes every period use the first period's value. The value references should be anchored by row only (F$10) or not anchored, so they move with the column. - Reordering rows without reordering the formula. If you insert a scenario row or swap upside and downside, every
CHOOSEthat points at that block must change too. Search for the old references after any such edit. - Bypassing the live row. Any formula that reads a scenario row directly will ignore the switch. Trace the precedents of a scenario row and confirm that only the live row uses it.
Reviewing a scenario switch
Test the switch before you trust it. Set it to 1, 2, and 3 in turn, and each time confirm that the live rows show the matching block and the scenario name matches. Then check that the output changes between scenarios. If a headline figure such as net income is identical in all three, some formula is bypassing the live row. Finally, type 0 and 4 into the switch and confirm that you see errors and that your check cell reports 1.
Exercise
A model has the switch in C2, with base, upside, and downside capital spending in rows 40, 41, and 42. Write the live-row formula for column F. Then explain what happens in column G if you copy it across and the switch reference was typed as C2 instead of $C$2.
Show answer
The formula is =CHOOSE($C$2,F40,F41,F42). If the switch is typed as C2, copying it to column G makes it D2... specifically it becomes D2 in column G (one column to the right of the original reference), so it points at an empty cell. An empty cell counts as 0, and CHOOSE with an index of 0 returns #VALUE!. The first period works and later periods show errors. Anchoring the switch as $C$2 fixes this.
Exercise
The switch cell C2 contains 2.9. What does =CHOOSE($C$2,F10,F11,F12) return, and which formula would flag this as an invalid switch value?
Show answer
CHOOSE truncates the index to 2, so it returns F11, the upside value, with no error. A check such as =IF(AND($C$2>=1,$C$2<=3,$C$2=INT($C$2)),0,1) returns 1 here, because 2.9 does not equal INT(2.9), which is 2. Data validation that allows only whole numbers from 1 to 3 would also have rejected the entry.