Sub topic 5
Restricting the Selector with a Data Validation Dropdown
This chapter assumes that you know basic spreadsheet formulas, absolute references such as $A$1, and the layout of a simple financial model. You should also understand how IF works. The goal is to make one cell control which scenario the model uses, without allowing misspelled or unsupported scenario names.
Why the selector needs validation
A scenario selector is an input cell that tells the model which case is active. Typical choices are:
- Base
- Upside
- Downside
If a user types Upside with an extra space, or Up-side with a hyphen, an exact lookup may fail. A data validation rule prevents these inconsistent entries. It replaces free typing with a controlled list.
The selector should be separate from the assumptions table. For example, use C3 as the live selector and keep the allowed names in B5:B7.
| Cell | Value | Purpose |
|---|---|---|
| C3 | Base | Current scenario selected by the user |
| B5 | Base | First allowed scenario |
| B6 | Upside | Second allowed scenario |
| B7 | Downside | Third allowed scenario |
Keeping the list in worksheet cells makes it visible and easy to audit. It also gives later formulas a consistent source for matching the selected name to a scenario number.
Create the dropdown list
First, enter the allowed scenario names in a vertical range. Avoid extra spaces before or after the names. Then select the selector cell, C3.
In Excel:
- Open the Data tab.
- Choose Data Validation.
- Set Allow to List.
- Set Source to
=$B$5:$B$7. - Keep the in-cell dropdown enabled.
- On the Error Alert tab, choose Stop.
- Add a message such as
Choose Base, Upside, or Downside.
In Google Sheets, select C3, choose Data > Data validation, and create a rule based on the range B5:B7. Select the option that rejects invalid data. Sheets may display the choices as a dropdown chip rather than Excel’s arrow, but the control has the same purpose.
The absolute references in =$B$5:$B$7 matter. They keep the list source fixed if you copy a formula or related formatting elsewhere. The list itself is not the scenario calculation. It only defines valid labels.
Data validation (Allow: List)
Source: =$B$5:$B$7
B5: Base
B6: Upside
B7: DownsideUnderstand the error behavior
A validation rule has two separate jobs:
- It provides a convenient list of valid values.
- It rejects values that are not in the list.
Use a blocking error style, such as Excel’s Stop alert, for a selector. A warning-style alert can allow the user to keep an invalid value. That defeats the purpose of a controlled switch.
A blank selector is also a design choice. If the model must always have an active scenario, do not include a blank item in the list. Set C3 to Base initially and add a visible model check that flags a blank or invalid selection.
Connect the selector to later formulas
The dropdown stores text, not a number. A later formula can convert that text to a scenario position. With Base, Upside, and Downside in B5:B7, this formula returns 1, 2, or 3.
=MATCH($C$3, $B$5:$B$7, 0)The final argument, 0, requires an exact match. If C3 contains a value outside the list, the formula returns #N/A. That error is useful during testing because it exposes a broken selector rather than silently choosing the wrong case.
A scenario switch can then use the resulting index to select a value from the corresponding assumption columns. The dropdown is therefore the user-facing control, while MATCH provides the numeric control used by the model.
Test the dropdown
Test both valid and invalid behavior before connecting the selector to important outputs.
- Select
Base,Upside, andDownsidefrom the dropdown. - Confirm that each value is accepted.
- Try entering
Upsidewith a trailing space. - Confirm that the error alert rejects it.
- Clear the cell and decide whether a blank should be allowed.
- Change one scenario label in the source list and confirm that the selector reflects the change.
Exercise
The scenario names are in B5:B7, and the selector is in C3. What data validation source should you use, and what should the MATCH formula return when C3 contains Upside?
Show answer
Use =$B$5:$B$7 as the list source. =MATCH($C$3,$B$5:$B$7,0) should return 2 because Upside is the second item in the list.