Sub topic 13
Auditing an Existing Model's Formatting
This chapter assumes you can use Excel or Google Sheets formulas and formatting, and that you have read the earlier chapters on font colours, fill colours, sign conventions, number formats and check cells. Here you apply those conventions in reverse. You inherit a model, and you test whether its formatting can be trusted.
Why audit formatting first
A formatting audit is a fast first pass over a model. It does not prove the numbers are right. It shows you where the model's own signals are unreliable. If a blue cell contains a formula, or a black cell contains a typed number, you can no longer trust the colour code. Every later review step then takes longer.
The audit has three goals:
- Find cells whose formatting contradicts their content.
- Find places where the sign, unit or scale convention is broken.
- Find checks that are missing, hidden or failing.
Treat each finding as a lead. Some inconsistencies are harmless, and others hide real errors.
Step 1: Read the structure and legend
Before you test anything, learn what the model claims to do. Open the cover sheet and look for:
- A legend of font and fill colours.
- The stated sign convention.
- The units and scale (for example, currency in millions).
- The summary check cell.
If none of these exist, write down the conventions you infer from a few rows and confirm them with the model's owner. You cannot call a cell inconsistent until you know the rule it should follow.
Then check the sheet order. A model usually flows from inputs to calculations to outputs. Sheets that break this order, such as an input buried in an output sheet, are a common source of hidden hardcodes.
Step 2: Find hardcodes with Go To Special
The most useful audit tool in Excel is Go To Special. Press F5, choose Special, and select an option.
| Option | What it selects | What to look for |
|---|---|---|
| Constants (numbers only) | Cells with typed numbers | Any that are not blue inputs |
| Formulas | Cells with formulas | Any that are blue |
| Formulas with Errors | Cells showing `#REF!`, `#DIV/0!` and so on | Errors left in the model |
| Row differences | Cells that differ from the first cell in the row | A formula that changes mid-row |
A practical routine:
- Select a calculation sheet and open Go To Special.
- Choose Constants and tick only Numbers. Excel selects every typed number.
- Look at the font colour of the selection. Any selected cell that is black is a hardcode disguised as a calculation.
- Repeat with Formulas. Any selected cell with a blue font is a formula disguised as an input.
You can also apply a temporary highlight. With the constants still selected, set a bright fill. Remove it when you finish, and note that you did so, because the fill is a change to the model.
Mixed formulas
A subtle case is a formula with a number inside it, such as =C10*(1+0.08). The cell is a formula, so it passes the colour test. The growth rate of 8% is still a hardcoded input. Search for these with Find (Ctrl+F) in formula mode, or turn on Show Formulas (Ctrl+ ) and scan for digits inside formulas. Constants like 1, 12 or 100` for unit conversion are usually acceptable if the model says so. Rates, prices and percentages are not.
Step 3: Check row consistency
A forecast row should use one formula across all forecast columns. Use these checks:
- Press
Ctrl+\after selecting a row to select cells that differ from the active cell in the row. In R1C1 reference style, identical logic looks identical, so a break stands out. - Turn on Show Formulas and compare neighbouring cells.
- Use
=FORMULATEXT(E10)in a helper column to display formulas, then compare them.
A change in formula between the last actual and the first forecast column is expected. A change anywhere else needs an explanation.
The following Python script automates this check for a saved workbook. It converts each formula to a relative pattern so that identical logic produces identical text, and it lists rows where the pattern changes.
import re
from openpyxl import load_workbook
from openpyxl.utils import get_column_letter, column_index_from_string
CELL = re.compile(r"(\$?)([A-Z]{1,3})(\$?)(\d+)")
def to_relative(formula, row, col):
"""Replace each A1 reference with an offset from the host cell."""
def repl(m):
col_abs, col_txt, row_abs, row_txt = m.groups()
c = column_index_from_string(col_txt)
r = int(row_txt)
c_part = f"C{c}" if col_abs else f"C[{c - col}]"
r_part = f"R{r}" if row_abs else f"R[{r - row}]"
return r_part + c_part
return CELL.sub(repl, formula)
def audit_rows(path):
wb = load_workbook(path)
for ws in wb.worksheets:
for row in ws.iter_rows():
patterns = {}
for cell in row:
value = cell.value
if isinstance(value, str) and value.startswith("="):
pattern = to_relative(value, cell.row, cell.column)
patterns.setdefault(pattern, []).append(cell.coordinate)
if len(patterns) > 1:
print(f"{ws.title} row {row[0].row}: {len(patterns)} formula patterns")
for pattern, cells in patterns.items():
print(f" {pattern} -> {cells[0]}..{cells[-1]} ({len(cells)} cells)")
if __name__ == "__main__":
audit_rows("model.xlsx")The script reports rows with more than one pattern. It does not decide which pattern is wrong. Rows that change at the actual/forecast boundary will appear in the output, and you dismiss those by reading them.
Step 4: Test colours with a script
You can also compare each cell's content with its font colour. This script flags typed numbers that are not blue, and formulas that are blue.
from openpyxl import load_workbook
BLUE = "000000FF"
def font_rgb(cell):
color = cell.font.color
if color is not None and color.type == "rgb":
return color.rgb
return None
def colour_audit(path):
wb = load_workbook(path)
findings = []
for ws in wb.worksheets:
for row in ws.iter_rows():
for cell in row:
v = cell.value
if v is None:
continue
is_formula = isinstance(v, str) and v.startswith("=")
is_number = isinstance(v, (int, float)) and not isinstance(v, bool)
is_blue = font_rgb(cell) in (BLUE, "FF0000FF")
if is_number and not is_blue:
findings.append((ws.title, cell.coordinate, "number not blue", v))
elif is_formula and is_blue:
findings.append((ws.title, cell.coordinate, "formula is blue", v))
return findings
if __name__ == "__main__":
for item in colour_audit("model.xlsx"):
print(item)Expect noise. Year headers such as 2026 are typed numbers, and they are often black on purpose. Filter them out, or accept them after a quick look. Theme colours and indexed colours also appear as non-RGB types, so the script treats them as "not blue". Check a few flagged cells by hand before you trust the list.
Step 5: Audit signs, units and number formats
Sign errors rarely show up in colours. Look for them with these methods:
- Total rows. For each subtotal, confirm whether it uses
SUM(costs stored as negatives) or subtraction (costs stored as positives). A mix in one statement points to a sign problem. - Cash flow links. Compare each cash flow line with its source. Depreciation is an expense on the income statement, and it is added back in cash flow. A same-sign link in the wrong direction doubles an error.
- Unusual signs. Select a row and scan for values with the opposite sign to their neighbours. A single positive cost in a row of negatives is a candidate error.
- Format check. Select the row and open Format Cells (
Ctrl+1). Confirm the number format is the model's standard, such as#,##0_);(#,##0);"-"_). A different format in the middle of a row can hide a negative or show a zero as a blank.
A hidden risk is a number format that disguises the value. The format 0.0, displays 1,500,000 as 1.5, which means the units column must say millions. A format with a hidden suffix, or a cell whose displayed value does not match its stored value, can mislead you. Click on suspicious cells and read the formula bar, which shows the stored value.
For units, scan the label column and the units column together. A row labelled "Revenue (£m)" that links to a row in thousands is a scale error. Check each cross-sheet link where the source and target units differ.
Step 6: Test the checks themselves
A passing check is only useful if it can fail. Test each one:
- Note the current summary check value.
- Change an input or break a link on purpose. For example, overwrite a balance sheet total with a typed number.
- Confirm the check turns red and the summary cell becomes non-zero.
- Undo the change with
Ctrl+Z, or close the file without saving.
Always work on a copy for this step. Also confirm that every check feeds the summary cell, and that the conditional format covers the whole row, including the newest columns. A check that returns 0 because it compares a cell to itself will always pass. Read its formula.
Step 7: Use the built-in tools
Excel has several tools that support the audit:
- Trace Precedents and Trace Dependents (Formulas tab) draw arrows to the cells a formula uses or feeds. Use them on any hardcode you find, to see what it affects.
- Error Checking (Formulas tab) flags inconsistent formulas, formulas that omit adjacent cells, and numbers stored as text.
- Inquire (an add-in in some Excel versions) can produce a workbook analysis, a cell relationship diagram and a comparison of two files.
- Find and Select > Conditional Formatting shows every cell with a conditional rule, so you can see where flags exist.
- Name Manager lists named ranges, including broken ones that show
#REF!.
In Google Sheets, the equivalents are fewer. Use Edit > Find and replace with "Search in formulas" for hardcodes, and a helper range with =ISFORMULA(A1) to separate formulas from typed values.
=ISFORMULA(C10) returns TRUE when C10 holds a formula
=FORMULATEXT(C10) shows the formula as text (Excel); Sheets uses =FORMULATEXT too
=ISNUMBER(C10) returns FALSE for numbers stored as textRecording what you find
Keep a findings log so the owner can fix issues and you can confirm the fixes. Use one row per finding.
| Sheet | Cell or range | Issue | Severity | Fix |
|---|---|---|---|---|
| Assumptions | C5 | Growth rate is black, typed | Low | Make font blue |
| IS | G12 | Formula contains `*1.05` | High | Move 5% to an input cell |
| CF | F20:N20 | Capex stored positive, others negative | High | Reverse sign, update total |
| BS | D60 | Check compares D40 to D40 | High | Link to D55 |
Rank findings by what they can change. A wrong colour on a label is low severity. A hardcode inside a formula, a mixed sign, or a broken check can change reported results.
Order of work
The steps above work best in a fixed order, because early findings make later steps faster.
Common errors in audits
- Trusting the colours. Colour is a claim, not proof. Confirm it against the cell content.
- Editing the original. Audit a copy. Highlights and test changes should never reach the live file.
- Stopping at the first sheet. Hardcodes often sit in later sheets, or in hidden rows and columns. Unhide everything before you start.
- Ignoring links to other files. Red-font links to external files can break or go stale. Use Data > Edit Links to list them.
- Fixing without logging. Without a log, you cannot show what changed, and the owner cannot review your edits.
Exercise
A reviewer selects every typed number on the Forecast sheet with Go To Special > Constants > Numbers. Three selected cells have a black font, and one cell with a blue font contains =B4*1.03. State what each finding means and what you would do.
Show answer
The three black cells are typed numbers presented as calculations. Check each one: if it is a real input, change the font to blue and consider moving it to the assumptions area. If it is a forgotten hardcoded override of a formula, replace it with the correct formula. The blue cell is a formula that carries a hardcoded growth rate of 3%. Its blue colour wrongly says "input", and the 3% is hidden inside the formula. Move 1.03 or 3% to a separate blue input cell, change the formula to reference it, and set the formula cell's font to black. Log all four findings, with the hardcoded rate in a formula rated higher severity.
Exercise
A balance check in row 60 always shows 0, even after you overwrite a balance sheet total with a typed number on a copy of the model. What does this tell you, and what do you do next?
Show answer
The check cannot fail, so it gives no protection. Read the formula in row 60. Likely causes are that it compares a cell to itself, that it points at the wrong rows, or that it points at a hardcoded copy of the totals. Correct the formula so it compares total assets with total liabilities plus equity, repeat the overwrite test to confirm that it now returns 1 and turns red, and check that it feeds the summary cell on the cover sheet.