Sub topic 8
Naming the Selector and Index for Readable Formulas
A scenario switch usually has two control cells:
- The selector stores the scenario name, such as Base, Upside, or Downside.
- The index stores the position of that name in the scenario list, such as 1, 2, or 3.
This chapter assumes that you know basic spreadsheet formulas, absolute and relative references, and the difference between model inputs, calculations, and outputs. It also assumes that you have already laid out the scenario assumptions and understand how MATCH and CHOOSE work.
Why use named ranges?
A formula such as =CHOOSE($C$4,E12,F12,G12) works, but the meaning of C4 is not obvious to someone reviewing the model. A name makes the role visible:
=CHOOSE(Scenario_Index,E12,F12,G12)The name Scenario_Index tells the reader that the formula expects a scenario position. Named ranges also reduce the risk of changing a control cell in one formula but missing it in another.
Use names for stable control cells and ranges that appear throughout the model. Do not name every cell. Too many names can make a workbook harder to navigate.
Define the selector and index names
Assume the assumptions sheet has this layout:
| Cell or range | Purpose | Example |
|---|---|---|
| C3 | Selected scenario name | Base |
| C4 | Scenario index | 1 |
| B5:B7 | Valid scenario names | Base, Upside, Downside |
| E12:G12 | Scenario-specific growth assumptions | 5%, 8%, 2% |
In Excel, open Formulas, Name Manager, and create these names:
- Scenario_Selected refers to Assumptions!$C$3.
- Scenario_Index refers to Assumptions!$C$4.
- Scenario_Names refers to Assumptions!$B$5:$B$7.
The dollar signs make the references absolute. If the cells move because you insert rows or columns, Excel usually updates the named-range definitions automatically.
Names must follow spreadsheet naming rules. They cannot contain spaces, begin with a number, or look like a cell address. Use underscores when needed. Keep names specific enough to communicate their purpose.
Use the names in the switch
The index formula can now refer to the selector and the scenario list by name:
=MATCH(Scenario_Selected,Scenario_Names,0)If Scenario_Selected contains Base, this formula returns 1. If it contains Upside, it returns 2. The final argument, 0, requires an exact match.
The live case row can use the named index:
=CHOOSE(Scenario_Index,E12,F12,G12)This formula selects the first, second, or third assumption according to ScenarioIndex. The scenario values still need to be in the same order as ScenarioNames.
A complete control section could therefore contain:
Scenario_Selected: Base
Scenario_Index: =MATCH(Scenario_Selected,Scenario_Names,0)
Live_Growth: =CHOOSE(Scenario_Index,E12,F12,G12)The names make the dependency chain easier to follow:
flowchart TD
A[Scenario_Selected] --> B[MATCH with Scenario_Names]
B --> C[Scenario_Index]
C --> D[CHOOSE selects one assumption]
E[Scenario assumptions] --> D
D --> F[Live case calculation]The diagram shows that the selector does not directly choose a number. MATCH converts the name into a position, and CHOOSE uses that position to select the assumption.
Names and data validation
Apply the selector's dropdown to the cell itself, not to the name. For example, apply list validation to Assumptions!$C$3 and use Scenario_Names as the source:
Data validation (Allow: List)
Source: =Scenario_NamesThis keeps the validation list connected to the same range used by MATCH. If you add a fourth scenario, update the Scenario_Names definition and the corresponding CHOOSE or live-case structure.
You can also name the input range for scenario assumptions. For example, GrowthAssumptions could refer to E12:G12. However, a row-specific name such as GrowthAssumptions may be misleading if it is used for only one driver. Prefer names that describe the scope clearly, such as RevenueGrowthCases.
Workbook scope and maintenance
Excel names normally have workbook scope, so formulas on different sheets can use Scenario_Index without a sheet prefix. This is useful for a central scenario control.
Avoid creating two names with the same text at different scopes unless you understand the precedence rules. A sheet-level name can override a workbook-level name and produce different results on different sheets.
When reviewing a model, inspect Name Manager for:
- Names that refer to deleted cells.
- Names that include the wrong sheet or range.
- Names with inconsistent spelling.
- Names that point to a single cell when a range was intended.
- Names used in formulas but no longer defined.
Google Sheets provides a similar feature through named ranges. The menu wording differs, but the principle is the same: assign a meaningful name to the selector, index, and reusable scenario list.
When direct references are better
A direct reference is acceptable when a cell is used once and its purpose is obvious from nearby labels. For example, a small calculation might use C4 directly. Use a name when the control appears across multiple sheets or when the formula would otherwise hide the model logic.
A useful compromise is to name the central controls and scenario list, while keeping ordinary calculation cells as regular references.
Exercise
If ScenarioSelected is Base, ScenarioNames refers to B5:B7, and B5:B7 contains Base, Upside, Downside, what does =MATCH(ScenarioSelected,ScenarioNames,0) return?
Show answer
It returns 1 because Base is the first item in the named scenario list.