Sub topic 14
Documentation and Version Control
This chapter assumes you can already separate a model into inputs, calculations, and outputs, apply the color conventions from earlier chapters, and run integrity checks. Here you will document the model so a stranger can use it, and you will version it so you can always say which file produced which number.
Why documentation belongs in the model
A model outlives the person who built it. Six months later, someone asks why revenue growth is 10% in year 3, which file went to the lender, or what changed between two sets of results. If the answers live only in email threads or in your memory, the model is hard to trust.
Structure already carries much of the meaning. A reader can see which cells are inputs, and every formula points back to them. Documentation adds what structure cannot show: purpose, scope, sources, decisions, and history.
Two rules keep documentation useful:
- Keep it next to the thing it describes. A note on the input row beats a separate Word file.
- Keep it short and current. A stale note is worse than no note, because readers believe it.
Documentation inside the workbook
A cover sheet
Put one sheet first in the workbook. It answers the questions a new reader asks before touching anything.
| Item | What to record | Example |
|---|---|---|
| Purpose | The decision the model supports | Evaluate a 3-year plan for Product A |
| Scope | What is in and out | Excludes financing and balance sheet |
| Units and currency | Default units for the workbook | USD, whole dollars, annual periods |
| Time axis | Start date, period length, number of periods | Years 1 to 3, Dec year-end |
| Structure | Sheet names and their layer | Inputs, Calc, Outputs, Checks |
| Owner | Who maintains it | Name and contact |
| Version | Current version ID and date | v1.3, 2026-11-28 |
| Status | Draft, reviewed, or approved | Reviewed |
The master check from the integrity chapter also belongs here. A reader should see "All checks pass" or the error count before reading anything else.
Source and notes columns on the inputs sheet
Every input row should carry its own documentation in columns beside the value:
- Unit, such as
fraction per yearorcurrency units. - Source, such as "Management budget, 2026-10-12" or "Industry report, table 4".
- Note, for judgment calls: "Held flat because the contract caps price increases."
This is the most valuable documentation in the model. When a number is challenged, you point to the source column instead of reconstructing the reasoning.
A change log
Add a sheet named Log. Each row records one change:
| Version | Date | Author | Sheet and cells | Change and reason |
|---|---|---|---|---|
| 1.2 | 2026-11-20 | AK | Inputs!C6 | COGS raised from 58% to 60% after supplier quote |
| 1.3 | 2026-11-28 | AK | Calc!E10:G10 | Revenue formula now reads growth from Inputs |
Record why, not only what. The "what" can be recovered by comparing files. The "why" cannot.
Cell comments and notes
Use comments sparingly, for one cell that needs a warning or an explanation. Do not use them for information that matters to every user, because they are easy to miss and hard to review in bulk. Anything important goes in a visible cell.
Documentation in the code version of the model
The Python example from this tutorial shows the same idea in code. Units are in the key names or comments, and docstrings state purpose. Adding a source and a version to the inputs makes the code self-documenting:
MODEL_VERSION = "1.3"
inputs = {
"revenue_year1": {"value": 1_000_000, "unit": "currency units", "source": "Management budget, 2026-10-12"},
"growth_rate": {"value": 0.10, "unit": "fraction per year", "source": "Sales plan, slide 7"},
"cogs_pct": {"value": 0.60, "unit": "fraction of revenue", "source": "Supplier quote, 2026-11-20"},
"opex": {"value": 150_000, "unit": "currency units per year", "source": "Budget line 4100"},
"tax_rate": {"value": 0.25, "unit": "fraction of positive EBIT", "source": "Statutory rate"},
"years": {"value": 3, "unit": "periods", "source": "Plan horizon"},
}
def values(inp):
"""Return a plain dictionary of input values for the calculation layer."""
return {name: spec["value"] for name, spec in inp.items()}
def describe(inp):
"""Print an assumptions register: one line per input."""
print(f"Model version {MODEL_VERSION}")
for name, spec in inp.items():
print(f"{name:15} {spec['value']:>12,} [{spec['unit']}] source: {spec['source']}")
describe(inputs)The calculation function from earlier receives values(inputs) and stays unchanged. The documentation travels with the inputs and can be printed as an assumptions register for reviewers.
Version control
Documentation says what the model is. Version control says which model you are looking at, and lets you return to an earlier one.
The file-name approach
Most spreadsheet models are versioned by file name. This works if you follow rules:
- Use a consistent pattern, such as
ProductA_Model_v1.3_2026-11-28.xlsx. - Use major and minor numbers. Increase the major number when structure or methodology changes. Increase the minor number for input updates and small fixes.
- Never use names like
final,final2, orlatest. They carry no order. - Keep one working copy in one agreed location. Archive older versions instead of leaving them beside the working copy.
- Save a new version before any significant change, and when you send the model to anyone.
The version in the file name must match the version on the cover sheet and the top entry in the log. A mismatch is itself a check you can make before releasing a file.
Git and text-based models
If the model is code, or if parts of it can be exported to text, use Git. Each commit stores a snapshot, an author, a date, and a message. Differences between versions are readable line by line.
Excel files are binary archives, so Git cannot show what changed inside them. Teams that want this benefit often use one of these approaches:
- Keep inputs in a CSV or JSON file that the model reads, and commit that file.
- Use a spreadsheet comparison tool to report formula and value changes between two versions.
- Store releases in a document system that keeps version history, and keep the change log in the workbook.
Because the three-layer structure isolates inputs, a scenario change should touch only the inputs file. A reviewer can then see a short diff and know that no logic changed.
Separating input changes from structural changes
Treat two kinds of change differently:
| Type of change | Example | Review needed | Version step |
|---|---|---|---|
| Input update | New tax rate | Check source and units | Minor |
| Structural change | New cost line, new sheet | Review formulas, rerun all checks | Major |
Do not mix them in one release. If you update the inputs and add a new calculation at the same time, any change in outputs has two possible causes and you cannot separate them.
Reconciling versions
When a new version changes results, explain the movement. A simple table works:
| Step | Net income, Year 3 |
|---|---|
| Version 1.2 | 123,000 |
| Change COGS to 60% | -20,000 |
| Change opex to 150,000 | -5,000 |
| Version 1.3 | 98,000 |
Each row should come from changing one thing at a time. The steps must add up to the new total, and that is another check to run.
Edge cases and common errors
- Stale documentation. A source column that names an old document misleads. Update the source whenever you update the value, and log it.
- Version mismatch. The file name says 1.3, the cover sheet says 1.2. Pick one source of truth, the cover sheet cell, and check the file name against it before release.
- Undocumented overrides. A hardcoded number typed over a formula is the worst case. Documentation cannot repair it. Use a scenario switch with a visible input instead, and log the reason.
- Several people editing copies. Two people each save a version 1.3 with different content. Assign one owner for releases, or use a naming rule that includes the author's initials for working copies.
- Documentation sprawl. Long manuals are rarely read. Prefer a cover sheet, per-input notes, and a log.
- Sensitive content. Notes and logs travel with the file. Remove comments about negotiations or personal data before sending the model outside the team.
A short release checklist
- All integrity checks pass, and the master check on the cover sheet is clear.
- Every new or changed input has a unit, source, and note.
- The log has an entry with version, date, author, location, and reason.
- The version matches in the file name, cover sheet, and log.
- Output changes are reconciled to the previous version.
- The release copy is archived, and the working copy is the only editable file.
Exercise
You change the tax rate input from 25% to 21% and, in the same edit, add a new line for depreciation to the calculation sheet. Net income rises by 12,000. Give two reasons this is poor practice for versioning, and say how you would release it instead.
Show answer
First, the 12,000 movement has two possible causes, the tax rate and the depreciation line, so you cannot explain or reconcile it. Second, the changes are different types: an input update needs a source check and a minor version, while a structural change needs formula review and a major version, so one release cannot carry the right review for both. Release them separately. Apply the tax rate change as version 1.4 with a log entry and source, reconcile the result, then add depreciation as version 2.0, rerun all checks, and reconcile again.
Exercise
A reviewer opens ProductAModelv1.3_2026-11-28.xlsx, but the cover sheet says version 1.2 and the top log entry is dated 2026-11-20. What should you conclude, and what should you do?
Show answer
The three version indicators disagree, so you cannot tell which version this file is. Do not release or rely on it. Compare it against the archived 1.2 and 1.3 copies to find which content it holds, correct the cover sheet, log, and file name so they match, and rerun the checks. Then add a pre-release step that compares the file name with the cover sheet version.