DEV Community

Daniel Marin
Daniel Marin

Posted on

I Used AI to Build a DCF, an LBO, and a 3-Statement Model. Here's What Actually Worked.

A practical guide for finance professionals who want to stop spending eight hours on cell linking and start spending that time on judgment calls.

Financial modeling is one of those disciplines where the thinking matters enormously but the execution is largely mechanical. You spend ten minutes deciding the right revenue growth assumption, then two hours wiring it through three linked statements, checking that the balance sheet balances, and formatting the output tab.

That ratio (high-judgment decisions surrounded by low-judgment plumbing) is exactly where AI delivers the most leverage.

This guide walks through how to use AI to build the three financial models that matter most in corporate finance and investment banking: DCF valuations, LBO models, and fully linked 3-statement models. The goal isn't to replace your judgment. It's to eliminate the hours of mechanical work around it.

Why Finance Professionals Are Starting to Use AI for Modeling

If you work in IB, PE, or FP&A, you already know the pain. A single DCF model can take 4 to 8 hours to build from scratch. An LBO model with multiple scenarios can take a full day. And when the MD walks in with "can you run this with 200bps higher WACC and show me the sensitivity table by tomorrow morning," you're not leaving the office.

AI doesn't change the finance. The models, the formulas, the accounting relationships are all the same. What it changes is who does the typing.

Before: You decide on assumptions, then spend hours linking cells, building schedules, formatting output. One circular reference and you're debugging for 45 minutes.

After: You describe the model structure and assumptions in plain English. AI generates the linked model, builds the schedules, and produces the output tabs. You review, adjust assumptions, and re-run. Total time: under an hour.

Crucially, the output isn't a black box. The AI generates the actual formulas and logic in a format you can inspect, audit, and modify. You stay in control of every assumption.

1. DCF Valuation: From Assumptions to Enterprise Value

The DCF is the foundation of intrinsic valuation. The model itself isn't complicated: project free cash flows, discount them back, add terminal value. The time sink is building the supporting schedules, linking revenue drivers through the income statement, computing unlevered FCF correctly, and formatting a clean output with a sensitivity table.

With an AI coding agent, you describe what you need and let it build the structure:

"Build a 10-year DCF for a SaaS company. Revenue is $50M growing at 25% declining to 15% by year 5. EBITDA margin expands from 20% to 35%. CapEx is 5% of revenue. WACC is 10%. Terminal growth rate is 3%. Include a sensitivity table on WACC and terminal growth."

The AI generates the full model: revenue build, operating expenses, EBITDA, D&A schedule, tax computation, unlevered FCF, discounting, terminal value (both perpetuity growth and exit multiple), bridge to equity value, and the sensitivity table. Every formula is visible and auditable.

Where AI saves the most time in DCF work:

  • Building the revenue bridge (bottoms-up with multiple drivers vs. top-line growth)
  • Linking D&A, CapEx, and NWC schedules to the income statement and balance sheet
  • Computing UFCF correctly (the conversion from EBITDA to unlevered FCF is where most manual errors happen)
  • Generating sensitivity and scenario tables across multiple assumption combinations
  • Reformatting an existing model when the MD wants "a different layout" at 11 PM

2. LBO Modeling: Leverage, Returns, and Scenario Analysis

LBO models are where complexity compounds. You have the operating model, then layered on top: a sources and uses table, a debt schedule with multiple tranches, mandatory and optional repayments, cash sweeps, PIK toggles, and returns analysis at various exit years and multiples. Each piece links to the others in ways that are easy to get subtly wrong.

The time-killing steps aren't the conceptual ones. They're the mechanical ones:

Debt waterfall. Building a multi-tranche debt schedule where senior debt is repaid first, then sub-debt, with different rates, amortization schedules, and optional prepayment logic. Getting the cash flow cascade right is a 90-minute exercise in careful cell linking.

Returns analysis. Computing IRR and MOIC at multiple exit years and exit multiples, then displaying it in a clean matrix. Simple in concept; tedious in Excel.

Scenario toggles. Base, upside, and downside cases that flow through the entire model. One mislinked cell and the downside case shows better returns than the base. That's the kind of error that surfaces in the IC meeting.

Here's what a prompt looks like for this kind of model:

"Build an LBO model. Purchase price 8x EBITDA on $100M LTM EBITDA. 5x senior at L+400 with 1% amort, 2x sub-debt at 10% PIK. Management rolls 10% equity. Revenue grows 8% declining to 5%. EBITDA margin stable at 30%. Exit in years 3 to 5 at 7x to 9x. Show IRR and MOIC matrix."

The payoff is sharpest when assumptions change. In a traditional workflow, re-running an LBO with different leverage or pricing takes 30 to 60 minutes of careful re-linking. With AI, you change the assumptions in the prompt and regenerate. The entire debt waterfall, returns table, and scenario matrix update in one pass.

3. Linked 3-Statement Models: The Foundation of Everything

Every DCF and LBO rests on a 3-statement model. The income statement, balance sheet, and cash flow statement must link perfectly. Net income flows to retained earnings, depreciation adds back in cash flow, changes in working capital reflect on both the balance sheet and cash flow statement. The balance sheet must balance.

This is the model type where AI assistance has the highest ROI, because it's also the one with the highest error rate. The classic mistakes (a sign flip in working capital, CapEx flowing as positive instead of negative, the cash balance not reconciling) happen because humans lose track of linkages across 200+ cells. An AI that generates the full structure in one pass doesn't have that problem.

The prompt is straightforward:

"Build a 3-statement model from this company's last 3 years of financials. Project 5 years forward. Revenue grows at 12%. Gross margin improves 50bps per year. SG&A as % of revenue declines from 30% to 25%. CapEx is 8% of revenue. D&A is tied to the PP&E schedule. Working capital ratios held constant."

The model links all three statements, builds supporting schedules (debt, depreciation, working capital), and includes a balance sheet check that flags if anything is out of balance. If you need to layer a DCF or LBO on top, the 3-statement model becomes the operating model input. You're building Lego blocks, not monoliths.

The Real Workflow: How Finance Teams Use This Day to Day

In practice, most analysts and associates don't use AI to build models from scratch every time. The more common pattern is:

  1. Generate a first draft with the deal or company's key assumptions.
  2. Review and adjust: swap in more nuanced assumptions, add company-specific line items, refine the revenue build.
  3. Run scenarios: generate base/upside/downside cases, or sensitivity tables across multiple variables.
  4. Audit the model: check for circular references, unlinked cells, sign errors, and balance sheet imbalances.
  5. Format for presentation: standardize colors, number formats, tab layout, and add a cover page and assumptions summary.

Steps 1, 3, 4, and 5 are almost entirely automatable. Step 2 is where your expertise lives, and where you should be spending your time. The net effect: a model that took a full day now takes 1 to 2 hours, and most of that time is judgment, not formula entry.

Common Concerns (and Honest Answers)

"Can I trust an AI-generated model?"

You should review it exactly as you'd review a model built by a first-year analyst. The logic is transparent. Every formula is visible, every assumption is labeled. The difference is that AI doesn't make typos or forget to link a cell. The errors it does make tend to be structural (wrong methodology, not wrong formula), which are easier to catch in review.

"Will this work with Excel?"

Yes. The output is structured data with clear formulas, not opaque code. You can open it directly in Excel or Google Sheets and modify any cell after generation exactly as you would in a hand-built model.

"Is my data secure?"

Claude Code runs locally on your machine. Your financial data, assumptions, and model outputs don't leave your environment unless you explicitly send them somewhere. This matters for deal teams working with material non-public information.

"Will this replace analysts?"

No. It replaces the mechanical parts of an analyst's job, the same parts that analysts themselves wish they didn't have to do. The judgment, the client communication, the deal structuring: that's still human work. AI just means fewer all-nighters reformatting the same model for the third time.

Getting Started

Start with whichever model you build most often. The first time you watch AI generate a linked 3-statement model with a working balance sheet check in under five minutes, the ROI becomes obvious. The second time, when the MD changes the assumptions at midnight and you regenerate in sixty seconds, it becomes indispensable.

I publish free playbooks for each of these model types (DCF, LBO, 3-statement, and more) at claudecodehq.com. Each one gives you a ready-made template you can drop into a project folder and start prompting against immediately. Worth a look if you want to cut your modeling time by 80% without changing your methodology.

Originally published on claudecodehq.com

Top comments (0)