- Conditional formatting changes a cell’s appearance based on its value—colour, icon or data bar—without manual intervention.
- Three rule families: cell highlight rules (greater than, between, contains), top/bottom rules, and formula-based rules, which are the most powerful.
- A formula-based rule is written for the first cell in the range, using mixed references ($D2) to highlight the entire row.
- Stick to at most 3 meaningful colours (red, amber, green) and documented thresholds so the table remains readable.
A tracking table that requires line-by-line reading is not a management dashboard. Excel’s conditional formatting automatically highlights what needs attention: an overdue customer, an overspent budget line, an approaching tax deadline. Here is how to use it effectively on an aged trial balance.
The scenario
An aged trial balance lists customers, their balance, their due date and their days overdue. Goal: show balances more than 90 days overdue in red, those 31 to 90 days overdue in amber, and receivables not yet due in green.
Step 1: prepare the calculation column
Days overdue are calculated from the due date and today’s date:
=MAX(0,TODAY()-C2)
For schedules frozen at a cut-off date, replace TODAY() with a cell holding the cut-off date (for example $B$1); otherwise the results change every time the file is opened.
Step 2: first rule by comparison
- Select the range D2:D7 (days overdue).
- Home > Conditional Formatting > Highlight Cells Rules > Greater Than…
- Enter 90 and choose “Light Red Fill with Dark Red Text”.
For the remaining thresholds, add a Between… rule for 31 and 90 (amber) and an Equal To… 0 rule (green).
Step 3: formula-based rule to highlight the entire row
Colouring only cell D leaves the rest of the row flat. A formula-based rule highlights the whole row:
- Select A2:E7.
- Conditional Formatting > New Rule > Use a formula to determine which cells to format.
- Formula:
=$D2>90 - Format: red fill.
Two essential technical points:
- the formula is written for the first cell in the selection (row 2);
- the column is locked with $ (
$D) while the row remains relative (2without $), so the rule evaluates each row using its own value in column D.
Figure 1: formatting result. Marker 1: the tested column; marker 2: a cell exceeding the 90-day threshold. (Note: the illustration shows the French-language Excel interface and labels, while all formulas and menu paths in the text use English Excel syntax.)
Step 4: order the rules
Manage Rules > Show formatting rules for: This Worksheet. Order matters: the top rule takes priority. Place the strictest rule (> 90) first and tick Stop If True so the row does not also receive the amber fill.
Other practical uses in accounting and finance
| Need | Rule |
|---|---|
| Budget exceeded by more than 10% | =$E2>$D2*1.1 across the row (E = actual, D = budget) |
| Tax deadline within 30 days | =AND($B2>=TODAY(),$B2-TODAY()<=30) |
| Duplicate invoices | Preset rule “Duplicate Values” on the invoice number column |
| Non-zero reconciliation difference | =ROUND($F2,2)<>0 (red) |
| Negative cash balance | “Less Than 0” (bold red) on the cash flow row |
| Sharp monthly variance | Icon sets (arrows) based on percentage variance |
| Relative weight of items | Data bars in the amount column |
Icon sets and data bars
- Data bars: a proportional bar inside the cell; suited to rankings (expenses by category).
- Icon sets: traffic lights, arrows; set thresholds as percentages or numbers based on business logic, as the default thresholds (33% / 67%) are rarely meaningful.
- Colour scales: a green-to-red gradient across a matrix (margin by product and by month).
Six ready-to-use rules
In Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format, here are six formulas to adapt. They are written for the first row of the range (row 2 here); column references are locked with a dollar sign to highlight the entire row.
| Need | Formula | Suggested colour |
|---|---|---|
| Overdue and unpaid invoice | =AND($D2<TODAY(),$E2="") |
Red |
| Due within the next 7 days | =AND($D2>=TODAY(),$D2<=TODAY()+7,$E2="") |
Amber |
| Duplicate invoice number | =COUNTIF($A:$A,$A2)>1 |
Yellow |
| Non-zero reconciliation difference | =ABS($H2)>0.005 |
Red |
| Entry posted on a Saturday or Sunday | =WEEKDAY($B2,2)>5 |
Grey |
| Paid invoice | =$E2<>"" |
Light green |
Example on a payment schedule
| No. | Customer | Due date | Payment date | Formatting |
|---|---|---|---|---|
| F-101 | Customer A | 05/03 | 04/03 | Light green (paid) |
| F-102 | Customer B | 10/03 | Red if today is after 10/03 | |
| F-103 | Customer C | 18/03 | Amber if today is between 11/03 and 18/03 | |
| F-103 | Customer D | 25/03 | Yellow: duplicate number F-103 |
The dollar sign is the key: $D2 locks column D while letting the row vary; without it, the rule shifts column by column and only formats the single cell.
Three traps to know
- Rule order matters: the first matching rule wins if “Stop If True” is ticked. Put the most severe alerts (overdue and unpaid) at the top.
- Rules apply to a range: inserting rows can fragment the range. Manage Rules > “Show formatting rules for: This Worksheet” lets you check and restore the full range.
- Today’s date recalculates:
TODAY()shifts colours from one day to the next without editing the file, which is the point, but makes screenshots short-lived; print or save to PDF on the day of the review.
Measuring the impact
A well-designed alert rule reduces late payments: on a twenty-customer due-date tracker, a few minutes of weekly review on the red and amber rows is enough to chase on time. The chase schedule in customer and supplier payment terms provides a clear action calendar.
A budget with variances: traffic lights and thresholds
For monthly budget tracking, a column Variance % = (Actual − Budget) ÷ Budget lets you colour-code rows by variance size. Three formula-based rules, applied to the variance range (for example F2:F40), in this order:
| Order | Formula | Format | Meaning |
|---|---|---|---|
| 1 | =ABS($F2)>0.15 |
Red | Variance above 15%: analysis mandatory |
| 2 | =ABS($F2)>0.05 |
Amber | Variance of 5% to 15%: monitor closely |
| 3 | =ABS($F2)<=0.05 |
Green | Acceptable variance |
Tick Stop If True on the first two rules so a red cell is not also formatted amber. For an expense line, a favourable variance (actual below budget) may warrant a different colour from an unfavourable overrun: =$F2>0.05 (overrun) and =$F2<-0.05 (saving).
Spotting duplicates in an invoice list
To spot two identical invoices (same supplier, same number, same amount), highlight duplicates: select the range, then Conditional Formatting > Highlight Cells Rules > Duplicate Values. For a duplicate across two columns (supplier and number), use a formula-based rule:
=COUNTIFS($A$2:$A$500,$A2,$B$2:$B$500,$B2)>1
Duplicate rows are highlighted across the entire row; you check them before payment, preventing duplicate payments—one of the costliest anomalies in accounts payable.
A payment schedule with date alerts
For a supplier invoice table with a due-date column (D) and a payment column (F, blank if unpaid):
| Status | Rule (formula) | Colour |
|---|---|---|
| Overdue and unpaid | =AND($D2<TODAY(),$F2="") |
Red |
| Due within 7 days | =AND($D2>=TODAY(),$D2<=TODAY()+7,$F2="") |
Amber |
| Due within 30 days | =AND($D2>TODAY()+7,$D2<=TODAY()+30,$F2="") |
Yellow |
| Paid | =$F2<>"" |
Grey |
Applying these rules to A2:H200 highlights each full row by status. Every day the workbook is opened, the table updates against today’s date. Sorted by due date, it works as a cash management tool.
Checking workbook consistency: control cells
A sound accounting workbook includes control cells that turn red if a total fails to match.
| Check | Formula | Formatting rule |
|---|---|---|
| Trial balance equilibrium | =SUM(Debit)-SUM(Credit) |
Red if ≠ 0: =ABS($B$2)>0.005 |
| Pivot total = source total | =Pivot_Total-SUM(Source[Amount]) |
Red if ≠ 0 |
| Unmatched keys | =COUNTIF(Results,"Unknown account") |
Red if > 0 |
| Reconciliation difference | =Adjusted_bank_balance-Adjusted_book_balance |
Red if ≠ 0 |
Place these cells at the top of each sheet so any reader can see immediately whether the workbook is reliable.
Do not overuse colours
Conditional formatting loses its value if everything is coloured. A few principles:
- Three colours at most and a visible legend.
- Flag the exception, not the norm: far better to highlight the 5% of rows that require action.
- Accessibility: combine colour with a symbol (icon, text) for colour-blind readers and black-and-white printing.
- Performance: limit ranges (
A2:H500rather than whole columns) and rule counts; hundreds of rules per sheet slow down the workbook. - Documentation: describe the rules in a “User Guide” tab, including thresholds and their rationale.
Managing, copying and cleaning up rules
Conditional Formatting > Manage Rules lists all rules on the sheet in priority order. You can adjust the Applies To range, reorder rules, or delete a rule. To copy formatting from one range to another, use the Format Painter or Paste Special > Formats. After repeated edits, duplicate rules build up: clean them up periodically. Before sending a workbook to an external party, verify that rules do not depend on hidden cells or sheets.
Best practices
- Document thresholds in a parameters cell (
=$D2>$K$1) so users can adjust them without editing rules. - Limit colours: red for urgent action, amber for monitoring, green for compliance.
- Always pair with text (a Status column) for printing and accessibility.
- Avoid full-column ranges (columns
A:Z): this slows down the file. - Clean up rules when copying and pasting sheets (they duplicate automatically).
- Test with boundary values (89, 90, 91).
Common mistakes
- Rule written for the wrong starting cell: shifted by one row.
- Absolute references everywhere (
$D$2): every row takes the colour of the first row. - Merged cells: rules behave unpredictably.
- Dates stored as text: comparisons fail; check with
=ISNUMBER(C2).
Special cases and edge situations
The rule only applies to the first row. The formula uses an incorrect relative reference: lock the column ($D2) while leaving the row relative so the rule extends across the range. Test the rule on three rows before rolling it out.
The workbook becomes slow. Hundreds of rules across entire columns slow recalculation. Restrict ranges to active rows (A2:H500) or convert the data into an Excel Table and apply the rule to the table column.
Colours disappear in black-and-white printing. Pair colour with a symbol (icon set, text “ALERT”) or bold font; check Print Preview.
The rule depends on another sheet. Recent Excel versions accept cross-sheet references in formula rules; for wider compatibility, use a defined name (Analysis_date, Alert_threshold) instead of a direct sheet reference.
A recipient sees different rules. Rules travel with the workbook, though copying cells into another file can duplicate or drop rules. Clean up rules via Manage Rules before distributing the file.
Key takeaway
Conditional formatting turns a table into an early-warning system: formula-based rules to highlight entire rows, at most three colours, a visible legend and control cells at the top of the sheet. Document the rules and keep ranges tight.
Frequently asked questions
Where is conditional formatting located?
Home tab, Styles group, Conditional Formatting button. Existing rules are managed through Manage Rules.
Why does my rule not apply to the entire row?
Because the Applies To range covers only one column, or the formula uses an absolute reference ($D$2). To highlight the row based on column D, apply the rule to A2:E50 with the formula =$D2>90.
Do colours show up when printed?
Yes, though they can become illegible in black and white: pair colours with a text column (Alert, Action) or with icon sets.
How many rules can you stack?
Excel allows many, but beyond three or four rules on the same range readability drops sharply. Rules apply in priority order; tick Stop If True where needed.
Article written from the official texts and the firm’s engagement practice. It shows its publication date and, where applicable, its last review.