Navigate
HomeStart here
MusingsResearch & long-form
BuildingProjects & learnings
WorkProfessional practice
RunningTraining & races
AboutValues & identity
Life & PlacesCulture, food, travel, cities
Notes & ArchiveJournals, essays, portfolio
← Back to Building
TOOLMar 2026

Trial-Ready Excel from Code

Consulting deliverables end up in Excel. The quality bar for expert testimony is "would this survive cross-examination?" So I built a Python engine that generates investment-bank quality workbooks.

excelconsultingfinancial-modelspythonxlsxwriter

In consulting litigation support, the Excel workbook IS the deliverable. Not the analysis behind it. Not the methodology memo. The workbook. It gets printed, bound, and handed to a judge. Opposing counsel reads every cell looking for something to discredit. A sloppy border, a missing source note, a formula that references the wrong row — any of these becomes "Your Honor, I’d like to direct the witness’s attention to cell F47."

David and I established the formatting standard over dozens of engagements. Garamond title blocks in red italic bold. A four-tier border hierarchy: hair for cell separation, thin for sections, double for totals, medium for grand totals. Every formula visible in a dedicated equation column so the opposing expert can audit the math without clicking into cells. Row numbers are clean on valuation sheets but bordered in data tables. Parenthetical negatives — ($1,234) not -$1,234 — because that’s what finance professionals expect. And no gridlines. Ever.

Axle is a Python engine that makes this formatting deterministic. `engine.py` handles the workbook structure, `styles.py` defines every format object, and template-specific modules like `components/cpi_module.py` handle the content. I built four demo templates: DCF Valuation, Comparable Companies Analysis, Reasonable Royalty Calculation, and Prejudgment Interest Calculator. Each one generates a complete workbook with print layout (landscape, exhibit marking in headers, page numbers, repeat row headers on every page).

The key insight is that formatting IS the deliverable. A correct model with sloppy formatting loses credibility at trial. The analyst’s DCF might be flawless, but if the borders are inconsistent and the source notes are missing, opposing counsel will argue the whole analysis is careless. Axle makes the formatting decision once, in code, and every workbook that comes out of it meets the standard. No manual formatting. No "I forgot to freeze the panes." No "the print area cuts off column M." The engine handles all of it, and the analyst focuses on the economics.

# Axle generates trial-ready Excel:
# engine.py → styles.py → template-specific module

# 4 templates:
# DCF Valuation
# Comparable Companies Analysis
# Reasonable Royalty Calculation
# Prejudgment Interest Calculator

# The formatting rules that survive cross-examination:
# - Garamond title blocks (red, italic, bold)
# - Hair → thin → double → medium border hierarchy
# - Every formula visible in equation column
# - Parenthetical negatives: ($1,234) not -$1,234
# - NO gridlines. Ever.
# - Print: landscape, exhibit marking, repeat headers