Sub topic 9
Validating Numeric Assumptions with Rules and Alerts
What this chapter assumes
You have already built the scenario switch. A dropdown selects Base, Upside or Downside, MATCH converts the name to an index, and CHOOSE feeds the chosen assumption into a live case row. This chapter protects the numbers that the switch selects. It assumes you are comfortable with absolute and relative references and with the IF and AND functions. The examples use Excel, and Google Sheets differences are noted where they matter.
Why assumption cells need rules
A scenario switch multiplies the number of places where a bad input can hide. A model with three scenarios and ten drivers has thirty assumption cells. Only ten of them are live at any moment. A typo in the Downside block can sit unnoticed until someone selects Downside, and then it distorts every output.
Typical input mistakes include:
- Typing
15instead of15%, which makes growth 1,500%. - Typing a sign wrong, so a cost decrease becomes an increase.
- Typing text such as
n/aor5 %into a numeric cell. Many formulas then return#VALUE!or silently ignore the cell. - Entering a value that is numeric but implausible, such as a tax rate of 250%.
Data validation prevents these at the moment of entry. It also documents your assumptions, because the rule states what range you consider reasonable.
The three parts of a validation rule
Each validation rule in Excel has three tabs under Data > Data Validation.
| Tab | Purpose | Example |
|---|---|---|
| Settings | The criteria a value must meet | Custom formula or Decimal between -0.5 and 1 |
| Input Message | A tooltip shown when the cell is selected | "Annual revenue growth, enter as a percentage between -50% and 100%" |
| Error Alert | What happens when the value fails the criteria | Stop alert titled "Growth out of range" |
You can use all three parts together. The input message tells the user what to type before they make a mistake. The error alert explains what went wrong after they do.
A custom rule for growth inputs
The built-in Decimal option with a between operator works for a simple range. A custom rule gives you more control, because you can combine conditions. This is the rule for the revenue growth inputs:
Data validation (Allow: Custom)
Formula: =AND(ISNUMBER(E12), E12>=-0.5, E12<=1)The formula is written as if the active cell is E12. Excel treats the references in a validation formula relative to the active cell when you create it. If you select E12:G12 first, with E12 as the active cell, Excel applies the same rule to F12 and G12 and shifts the reference to F12 and G12 automatically.
Each part of the formula does one job:
ISNUMBER(E12)rejects text, including numbers typed with a stray space or letter.E12>=-0.5sets the lower bound at -50%.E12<=1sets the upper bound at 100%.
AND returns TRUE only when all three tests pass. Excel accepts the entry when the formula returns TRUE and rejects it when the formula returns FALSE.
The ISNUMBER test matters because comparison operators treat text differently from numbers. In Excel, any text compares as greater than any number. A text entry such as abc would therefore pass E12>=-0.5, and ISNUMBER is what stops it.
Limits stored in cells
Hard-coded limits such as -0.5 and 1 inside a validation rule are hard to find and update later. A better layout keeps the limits in visible cells beside the driver. Suppose the lower bound is in H12 and the upper bound is in I12:
Data validation (Allow: Custom)
Formula: =AND(ISNUMBER(E12), E12>=$H12, E12<=$I12)The column anchors ($H, $I) keep the limits fixed while the row can shift if you copy the rule to other drivers. Anyone reviewing the model can now see the permitted range in the sheet without opening the validation dialog.
Error alert styles
The error alert has three styles. The style you choose decides whether the rule is a hard wall or a prompt.
| Style | Buttons shown | Effect on the entry |
|---|---|---|
| Stop | Retry, Cancel | The entry is rejected. |
| Warning | Yes, No, Cancel | The user may keep the invalid value by choosing Yes. |
| Information | OK, Cancel | The user may keep the invalid value by choosing OK. |
Use Stop for values that make the model meaningless, such as text in a numeric driver or a tax rate above 100%. Use Warning for values that are unusual but possible, such as growth above 40%. A warning lets an analyst override a rule when they have a reason, while still forcing them to confirm it.
Write alert text that says what to do. Compare these two messages:
- Poor: "The value you entered is not valid."
- Better: "Enter revenue growth as a percentage between -50% and 100%. For example, type 8% or 0.08."
In Google Sheets, the equivalent choice is Reject input or Show a warning under the advanced options of the validation rule.
A rule that keeps scenarios in order
You can also validate relationships between scenarios. For revenue growth, the Upside value should not be lower than the Base value, and the Base value should not be lower than the Downside value. A custom rule on the Upside cell F12 can enforce the first relationship:
Data validation (Allow: Custom)
Formula: =AND(ISNUMBER(F12), F12>=E12, F12<=1)Use a Warning style here and not Stop. There are cases where a scenario ordering is intentionally reversed, such as for a cost driver where the Downside value is higher. Put the rule only where the ordering is always true, and make the alert text say which relationship the user is breaking.
The diagram below shows the full path of an entry through validation and the backstop check described later in this chapter.
What validation does not catch
Validation is a convenience for typing, not a guarantee. Know its limits before you rely on it.
- Pasting overwrites the rule. Pasting a value from another cell replaces the destination cell's validation with the source cell's. A plain paste of a number from outside the workbook skips the test completely. Use Paste Special > Values to avoid replacing the rule, though even this does not run the test on the pasted value.
- Existing values are not re-tested. If you add a rule to a cell that already holds a bad value, nothing happens until someone edits the cell.
- Formulas are not tested. Validation applies only to typed entries. If an assumption cell holds a formula, the result is never checked.
- Blank cells pass by default. The Ignore blank option is on by default. With a custom formula, a blank cell can still be accepted, depending on how the formula treats an empty cell, so test this explicitly.
- Percent entry is a formatting issue. In Excel, a cell formatted as a percentage usually interprets
5as 5%, but a cell with General format stores 5, which means 500%. The rule checks the stored value, so format the cells before you rely on the bounds.
Excel can show you values that already break a rule. Choose Data > Data Validation > Circle Invalid Data to draw red circles around them. Use this after pasting a block of assumptions into the sheet. Use Clear Validation Circles to remove the circles.
A backstop check for stored values
Because validation can be bypassed, add a formula that tests the stored values. This is a model integrity check, in the same style as the check you built for the scenario index. The following formula returns 0 when all three growth assumptions are numbers within the allowed range and 1 otherwise:
=IF(AND(COUNT(E12:G12)=3, MIN(E12:G12)>=-0.5, MAX(E12:G12)<=1), 0, 1)COUNT counts only cells that hold numbers, so a text entry makes the count less than 3 and triggers the failure. The MIN and MAX tests check the range for all three scenarios at once, including scenarios that are not currently selected. That coverage is the point: the live case row only tests the selected scenario, but this check tests the whole block.
Place one such check beside each driver row. Then add the results into the master check, using the same pattern as the scenario index check. A master check of 0 means every rule held. A positive number means at least one driver needs attention.
If you stored the bounds in cells, reference them in the check so the rule and the backstop always agree:
=IF(AND(COUNT(E12:G12)=3, MIN(E12:G12)>=$H12, MAX(E12:G12)<=$I12), 0, 1)Common mistakes
- Writing the formula against the wrong active cell. If E12 is the active cell but the rule refers to E13, every cell in the range is tested against the cell below it. Always check the active cell before you open the dialog.
- Using absolute references for the tested cell.
=AND(ISNUMBER($E$12), ...)tests the same cell for every cell in the range. Use a relative reference for the tested cell and absolute references only for limits. - Setting the alert to Information. This style lets the user keep an invalid value with one click, so it rarely protects anything. Choose Stop or Warning.
- Leaving the error alert tab empty. If you do not enter a title and message, Excel shows a generic "This value doesn't match the data validation restrictions" text. Users then have no way to know which limit they broke.
- Treating validation as a replacement for checks. The rule guards typing and the check guards the stored result. A reliable model has both.
Putting it together
For each numeric driver in the assumptions block, the working pattern is:
- Store the lower and upper bounds in cells beside the driver.
- Apply a custom rule that combines
ISNUMBERwith both bounds, with the tested cell as a relative reference. - Add an input message that states the unit and the range.
- Add an error alert, using Stop for impossible values and Warning for unusual ones.
- Add a row-level check with
COUNT,MINandMAXthat covers all scenarios, and include it in the master check.
Exercise
A custom validation rule on the range E12:G12 is entered with E12 as the active cell as =AND(ISNUMBER($E$12), $E$12>=-0.5, $E$12<=1). A user types the text abc into G12, and Excel accepts it. Explain why, and write the corrected rule.
Show answer
The rule uses absolute references to E12, so every cell in the range is tested against the value in E12 and not against its own value. E12 holds a valid number, so the test passes for abc in G12. The corrected rule uses a relative reference for the tested cell: =AND(ISNUMBER(E12), E12>=-0.5, E12<=1). Applied to E12:G12 with E12 active, Excel shifts the reference to F12 and G12 for those cells.
Exercise
Write a formula that returns 0 when the Base, Upside and Downside tax rates in E20:G20 are all numbers between 0% and 60%, and 1 otherwise. Why is it still needed when the cells already have a validation rule?
Show answer
=IF(AND(COUNT(E20:G20)=3, MIN(E20:G20)>=0, MAX(E20:G20)<=0.6), 0, 1). It is still needed because validation only tests typed entries. A pasted value, a value that existed before the rule was added, or a formula result is never tested, so the check re-tests the stored values and feeds the master check.