Sub topic 8
Formatting the table and highlighting the base case
A data table that returns correct numbers can still be hard to read. A grid of 35 unlabeled values hides the pattern, and a reader cannot tell which cell matches the model's current assumptions. This chapter covers number formats, header labels, a color scale for the sensitivity pattern, and a conditional formatting rule that marks the base case.
It assumes you can build the two-variable loan table from earlier chapters, that you understand absolute and relative references ($B$2 vs B2), and that you have used the Conditional Formatting menu at least once.
The layout used in this chapter
The examples use the loan model and two-variable table from the previous chapters:
- Inputs:
B1loan amount (300000),B2annual rate (0.065),B3term in years (30). - Output:
B4monthly payment,=PMT(B2/12, B3*12, -B1). - Table corner:
D2is=B4. - Term values across the top:
E2:I2hold 10, 15, 20, 25, 30. - Rate values down the side:
D3:D7hold 4.5%, 5.5%, 6.5%, 7.5%, 8.5%. - Results:
E3:I7hold{=TABLE(B3,B2)}.
Format each part of the table for its job
A data table has four visual parts, and each needs different treatment.
| Part | Cells | Formatting goal |
|---|---|---|
| Corner cell | `D2` | Hide the duplicate output or turn it into an axis label |
| Top axis | `E2:I2` | Show clearly what the values are (years) |
| Side axis | `D3:D7` | Show clearly what the values are (percent) |
| Result grid | `E3:I7` | Match the output's units, with a consistent number of decimals |
Number formats
Format the grid the way you would format the model output. The monthly payment in B4 is currency, so use a currency format with no decimals for a payment of this size, such as $#,##0. Apply the same format to every grid cell. Mixed formats make the reader compare digits instead of patterns.
Format the side axis as a percentage with the precision your steps need. Steps of 1% work with 0.0%. If you test 6.25% and 6.50%, use 0.00%. A format that rounds the display can make two different axis values look identical.
Format the top axis with a custom number format such as 0 "yrs". The cell still holds the number 30, so the table works, but the header reads 30 yrs.
Turning the corner cell into a label
The corner cell D2 must contain the output formula, so you cannot type a label there. You can change how it looks. Give it a custom number format that is only a quoted string:
Format Cells > Number > Custom
Type: "Rate / Years"The cell displays Rate / Years but still holds the payment value, so the table keeps working. Select the cell and read the formula bar to confirm it still shows =B4. A common alternative is the format ;;;, which hides the value completely. Use the label version, because it tells the reader which axis is which.
Use a distinct fill or bold font for the axes so the reader sees where the inputs end and the results begin. Keep the axis cells hardcoded numbers. Do not link them to the input cells B2 or B3. During calculation Excel substitutes values into those input cells, and linked axis values would change in the middle of the substitution and give wrong results.
Show the sensitivity pattern with a color scale
A color scale shades each cell by its value, so the direction and steepness of the sensitivity are visible at a glance.
- Select the result grid
E3:I7. Do not include the axes or the corner. - Choose Home > Conditional Formatting > Color Scales.
- Pick a two-color or three-color scale.
For a loan payment, a higher value is worse for the borrower. Use a scale where the highest value is red and the lowest is green or white. For an enterprise value, the direction reverses, so check which end of the scale gets which color. A scale with the wrong direction tells readers the opposite of the truth.
A color scale applies to the cells you selected at the time. If you later resize the table by adding a new row, extend the rule through Conditional Formatting > Manage Rules and edit the "Applies to" range.
Highlight the base case with a formula rule
The base case is the grid cell where the rate and term equal the model's current inputs. The model changes as users change B2 and B3, so the highlight should move with them. Hardcoding a fill on G5 would not move. A conditional formatting rule does.
Apply this rule to E3:I7:
Conditional formatting rule applied to E3:I7:
=AND($D3=$B$2, E$2=$B$3)To create it:
- Select
E3:I7, withE3as the active cell. - Choose Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format.
- Enter the formula above.
- Click Format and choose a bold font and a thick-looking border (see the next section for the limits).
Why the references look the way they do
Excel evaluates the formula once for each selected cell, written relative to the active cell E3. The mixed references control what changes:
$D3locks the column toDand lets the row move. Each grid row compares its own rate header with the rate input.E$2locks the row to2and lets the column move. Each grid column compares its own term header with the term input.$B$2and$B$3are fixed on the inputs, so every cell compares against the same two values.
A frequent mistake is writing $D$3 or E2 by accident. Then every cell compares against the same header, and either no cell highlights or the whole grid does.
Note also which input goes with which axis. The rate input B2 is compared with the side headers in column D. The term input B3 is compared with the top headers in row 2. This is the same pairing as the data table dialog, where the row input cell B3 matches the values across the top.
Combine the rules without conflicts
You will usually have two rules on the same range: the color scale and the base-case rule. Conflicts arise when both try to set the same property, such as fill color.
- Let the color scale own the fill.
- Let the base-case rule own the font (bold) and the border.
Conditional formatting borders are limited to thin line styles, so use a dark color to make the border stand out. Open Manage Rules to check the order. If you do want a fill for the base case, move the base-case rule above the color scale, because rules higher in the list win when they conflict.
Make the highlight robust
Floating-point mismatches
The rule uses exact equality. If a rate is typed as 0.065 in both places, the comparison works. If one is the result of a calculation, such as =0.05+0.015, binary floating-point arithmetic may leave a tiny difference, and the highlight silently fails. Compare rounded values instead:
=AND(ROUND($D3-$B$2,8)=0, E$2=$B$3)Terms in whole years are safe with plain equality. Rates and growth rates are the usual source of trouble.
A missing highlight is information
If no cell highlights, the current inputs are not on the axes. For example, if someone changes B2 to 6.0%, no row header equals 6.0%. Do not treat this as a bug in the rule. It tells you the base-case check cannot be done against this grid. Either add the value to the axis or reset the input. Pair the rule with the check cell from the previous chapter:
K2: =E5-B4This cell should be 0 when E5 is the base-case cell. It fails if the layout changes, while the highlight shows where the base case sits in the grid.
Do not format the formula cell as the answer
Some people center the axis on the base case, so the highlighted cell sits in the middle of the grid. Symmetric axes (for example 5.5%, 6.0%, 6.5%, 7.0%, 7.5%) make the table easier to read. They also make errors easier to spot, because the center cell must equal the model output.
Keep formatting from changing the table
Formatting does not change TABLE results, but two actions near it can cause problems:
- You cannot edit one cell inside
E3:I7. Excel reports that you cannot change part of a data table. Apply formats to the whole range at once, which is allowed. - Inserting or deleting a row or column inside the results range is also blocked. Resize the table by clearing the whole result range, adjusting the axes, and running the Data Table dialog again. Then update the "Applies to" range of your formatting rules.
Checklist
- Axes are hardcoded values, not links to input cells.
- Corner cell shows a label through a custom number format and still holds the output formula.
- The grid uses one number format that matches the output's units.
- A color scale has the direction that matches good or bad for the metric.
- The base-case rule uses
$D3andE$2against$B$2and$B$3, applied to the grid only. - The check cell
K2is 0, and the highlight appears on the expected cell.
Exercise
You apply the rule =AND($D$3=$B$2, E$2=$B$3) to E3:I7, and only one cell in the top row ever highlights, never the base case in row 5. What is wrong, and what is the corrected formula?
Show answer
The reference $D$3 is fully absolute, so every grid cell compares the same rate header (the one in row 3) with B2. The row part of the reference must be allowed to move. The corrected formula is =AND($D3=$B$2, E$2=$B$3), with the column locked and the row relative for the side header.
Exercise
A colleague sets the corner cell D2 to the custom number format ;;; and says the table is now broken because D2 looks empty. Is the table broken? How do you check?
Show answer
No. The format only hides the display, and D2 still holds =B4. Select D2 and read the formula bar, or check that the grid cells still change when you edit B2. For a more readable result, use a label format such as "Rate / Years" instead.