Sub topic 11
When to Use INDEX or XLOOKUP Instead of CHOOSE
This chapter assumes you know basic spreadsheet formulas, absolute and relative references, and how a financial model separates inputs, calculations, and outputs. It also assumes you understand the scenario selector and the MATCH formula from earlier chapters.
CHOOSE is useful when a scenario name has already been converted to a small, reliable index. However, INDEX and XLOOKUP can make the model easier to extend and maintain. The best choice depends on how your assumptions are arranged and how often the scenario structure may change.
The three selection methods
Suppose the assumptions sheet contains this layout:
| Driver | Base | Upside | Downside |
|---|---|---|---|
| Revenue growth | 5% | 9% | 1% |
| Operating margin | 20% | 24% | 16% |
The live case row needs to return the value for the selected scenario. If C4 contains 1 for Base, 2 for Upside, or 3 for Downside, CHOOSE can select the corresponding value.
=CHOOSE($C$4, E12, F12, G12)This is clear when there are only a few fixed scenarios. The formula explicitly lists each alternative. It becomes less convenient when scenarios are added, reordered, or stored in a larger table.
INDEX selects a value by position from a range:
=INDEX($E12:$G12, $C$4)Here, the first argument is the row's scenario range. The second argument is the position supplied by C4. If C4 is 2, INDEX returns the value in F12.
XLOOKUP selects a value by matching a label:
=XLOOKUP($C$3, $E$11:$G$11, $E12:$G12, "Scenario not found")If C3 contains Upside, XLOOKUP finds Upside in E11:G11 and returns the value from the matching position in E12:G12.
Choosing between position and label
Use CHOOSE when the alternatives are few, fixed, and intentionally ordered. It works well for a simple switch where the index is controlled by MATCH and the formula needs to be immediately readable.
Use INDEX when the scenarios form a contiguous range and the model already has a numeric scenario index. INDEX is usually shorter than CHOOSE when each row uses the same scenario columns.
Use XLOOKUP when the scenario name itself should drive the selection. XLOOKUP avoids a separate name-to-index step and makes the formula less dependent on column order.
| Method | Selects by | Main strength | Common risk |
|---|---|---|---|
| CHOOSE | Position | Very explicit for a few alternatives | Long formulas become hard to update |
| INDEX | Position | Efficient for a contiguous range | Wrong index or range can return the wrong case |
| XLOOKUP | Label | Clear and flexible when labels are stable | Duplicate or misspelled labels can cause errors |
A practical decision rule
Ask these questions before choosing a formula:
- Are the scenarios stored in adjacent columns or rows?
- Is the selector a name, such as Upside, or an index, such as 2?
- Will users add scenarios later?
- Must the formula work in older spreadsheet software?
If the answer to the third question is yes, XLOOKUP is often the clearest choice. If the model already uses a validated numeric index, INDEX is usually efficient. CHOOSE remains suitable for a small, fixed set of cases.
How the formulas fail
CHOOSE and INDEX can silently select the wrong assumption if the scenario index does not match the range order. For example, if the headers are reordered but the index mapping is not updated, 2 may no longer mean Upside.
XLOOKUP makes label errors more visible. A misspelled scenario name can return the message supplied in the fourth argument. However, duplicate headers are dangerous because XLOOKUP returns the first match. A blank header can also make the model difficult to audit.
Use a validation check alongside any method. A master check should flag an invalid index, a missing label, or a mismatch between the selector and the live case row.
Worked comparison
Assume C3 contains the validated name Upside, C4 contains its MATCH result of 2, and the revenue growth assumptions are in E12:G12.
All three formulas should return 9%:
=CHOOSE($C$4, E12, F12, G12)
=INDEX($E12:$G12, $C$4)
=XLOOKUP($C$3, $E$11:$G$11, $E12:$G12, "Scenario not found")The results match, but their dependencies differ. CHOOSE depends on the order of its arguments. INDEX depends on the position and range. XLOOKUP depends on matching labels.
Exercise
The model has five scenario columns, users select a scenario by name, and scenarios may be added later. Which method is the best default, and why?
Show answer
Use XLOOKUP because it selects by the scenario label, avoids a separate index conversion, and remains easier to extend when new scenarios are added.