Sub topic 16
Number Formats for Checks and Flags
Assume you can write formulas, use relative and absolute references, and understand basic financial statements. This chapter focuses on making model checks readable without hiding the underlying calculation.
Why checks need deliberate formatting
A model check tests whether two related values agree. For example, a balance sheet check compares total assets with total liabilities and equity:
=IF(ABS(Total_Assets-(Total_Liabilities+Total_Equity))<0.1,0,-1)This formula returns 0 when the difference is within 0.1 units. It returns -1 when the difference is outside that tolerance. A tolerance prevents harmless floating-point differences from appearing as errors.
Apply this custom number format to the result:
[Green]"OK";[Red]"ERROR";[Green]"OK"Excel custom formats use sections separated by semicolons. The sections apply to positive numbers, negative numbers, zero, and text, in that order.
| Stored result | Display | Meaning |
|---|---|---|
| `0` | OK | The check passes within tolerance |
| `-1` | ERROR | The check fails |
| Text | The original text | The format does not replace text values |
The cell still stores 0 or -1. The format changes only what the worksheet displays. You can therefore use the result in other formulas even though the user sees a word.
Design checks that expose the cause
A visible flag tells you that something is wrong, but a numeric difference helps you investigate it. Keep a diagnostic cell beside the flag:
=Total_Assets-(Total_Liabilities+Total_Equity)Format the diagnostic cell with a financial format such as:
#,##0.0_);(#,##0.0);"-"_ )This displays positive values normally, negative values in parentheses, and zero as a dash. Remove the extra space before the final closing parenthesis if your Excel version rejects the format:
#,##0.0_);(#,##0.0);"-"_ )For a simpler version without alignment padding, use:
#,##0.0;(#,##0.0);-A check should also have a clear label, such as Balance sheet check or Cash roll-forward check. Place checks in a consistent area so reviewers can find them quickly.
Number formats versus conditional formatting
Custom number formats work well when a check has a simple sign-based result. Conditional formatting is better when the rule depends on a threshold, several conditions, or a visual scale. For example, you can show a diagnostic difference in red when its absolute value exceeds 0.1.
Do not use a green format to make an unchecked or blank cell look successful. Test blanks explicitly:
=IF(Check_Input="","",IF(ABS(Difference)<0.1,0,-1))This leaves the result blank until the required input exists.
Exercise
Why should a check formula return -1 for an error when its custom format treats negative values as ERROR?
Show answer
The negative result selects the second custom-format section, so Excel displays ERROR while the stored value remains available for formulas and audits.