Sub topic 3
Naming the Selector and Index for Readable Formulas
This chapter assumes you can write formulas with cell references, know the difference between $A$1 and A1, and have a model with inputs, calculations and outputs. It also builds on the selector, index and CHOOSE setup from earlier chapters.
Naming the Selector and Index
A named range is a label for a cell or range. A formula that reads Scenario_Index is easier to audit than one that reads Assumptions!$C$4.
Define two names:
Scenario_Namerefers to the dropdown cell,Assumptions!$C$3.Scenario_Indexrefers to the cell that converts the name to a number,Assumptions!$C$4.
In Excel, use Formulas > Define Name. The live formula then reads:
=CHOOSE(Scenario_Index, E12, F12, G12)Validating Numeric Assumptions with Rules and Alerts
The dropdown controls which scenario is active, but it does not stop a typed growth rate of 500 when you meant 5%. Apply a custom validation rule to the growth input cells, such as E12:G12:
=AND(ISNUMBER(E12), E12>=-0.5, E12<=1)Set the error alert style to Stop to reject bad entries. Use Warning if you want to allow an override after confirmation.
Reading and Comparing Scenario Outputs
The live case shows one scenario at a time. To compare scenarios, set the selector to each name, then copy the key output into a comparison table as values. A Data Table (What-If Analysis) can run all three scenarios automatically.
| Scenario | Index | Year 3 Revenue |
|---|---|---|
| Base | 1 | Record value |
| Upside | 2 | Record value |
| Downside | 3 | Record value |
When to Use INDEX or XLOOKUP Instead of CHOOSE
CHOOSE picks a value by position from a fixed list. It suits three or fewer scenarios. INDEX works on a range and stays short as scenarios grow:
=INDEX($E12:$G12, Scenario_Index)XLOOKUP matches on the name instead of a number. It requires Excel 2021 or Microsoft 365, and the header row must contain the same names as the dropdown:
=XLOOKUP(Scenario_Name, $E$5:$G$5, E12:G12)Checks and Common Mistakes
Add a check cell that returns 0 when the index is valid:
=IF(AND(ISNUMBER(Scenario_Index), Scenario_Index>=1, Scenario_Index<=3), 0, 1)Link this check to a master check on the cover sheet. Watch for these mistakes:
- Using
E12instead of$E12when copying formulas, so references shift. - Hard-coding 3 in a range check, so a new scenario is ignored.
- Typing a name that does not match the header, which makes XLOOKUP return #N/A.
- Leaving the selector blank, which makes CHOOSE return an error.
Exercise
The growth input in E12 must be a percentage between -50% and 100%. Which custom validation formula enforces this?
Show answer
=AND(ISNUMBER(E12), E12>=-0.5, E12<=1)