Skill Tracer
Skills › Financial Services › dcf-model

dcf-model

skill · 1264 lines · Apache-2.0 · plugins/vertical-plugins/financial-analysis/skills/dcf-model/SKILL.md

The facts

Its description

Real DCF (Discounted Cash Flow) model creation for equity valuation. Retrieves financial data from SEC filings and analyst reports, builds comprehensive cash flow projections with proper WACC calculations, performs sensitivity analysis, and outputs professional Excel models with executive summaries. Use when users need to value a company using DCF methodology, request intrinsic value analysis, or ask for detailed financial modeling with growth projections and terminal value calculations.

The description the agent reads to decide when to use it.

From its settingsline 3

When it starts

The agent sees only the name and description, which say this skill builds real DCF (Discounted Cash Flow) equity valuation models with cash flow projections, WACC, sensitivity analysis and Excel output. It would be picked when someone asks to value a company by DCF, wants an intrinsic value analysis, or asks for a detailed financial model with growth projections and terminal value.

Things a person might say (the model's guesses)

  • “Build me a DCF model for Apple”
  • “What's the intrinsic value of Microsoft based on discounted cash flow?”
  • “Can you do a DCF valuation of Tesla with 5-year projections and a WACC calculation?”

A model's summary of when it is used.

A model's reading

Runs scripts

python recalc.py

Scripts the text names. Found by matching words, so treat them as pointers.

Files it mentions

./TROUBLESHOOTING.md

Files the text names, such as ones to read or write. Found by matching words, so treat them as pointers.

Found by matching wordsline 1191 line 1229

What it leads to

Other skills this one hands off to, calls, requires or offers instead, as a model read them.

A model's reading

What leads to it

Other skills that hand off to this one, call it, require it or offer it instead, as a model read them.

A model's reading

Licence

Apache-2.0, from LICENSE

The terms its author shares it under, which let it be shown here.

From the repositorylicence text
Other files in this skill (3) Close

The text

Open on GitHub

Most marks come from matching words in the file, so treat them as pointers.

1---
2name: dcf-model
3description: Real DCF (Discounted Cash Flow) model creation for equity valuation. Retrieves financial data from SEC filings and analyst reports, builds comprehensive cash flow projections with proper WACC calculations, performs sensitivity analysis, and outputs professional Excel models with executive summaries. Use when users need to value a company using DCF methodology, request intrinsic value analysis, or ask for detailed financial modeling with growth projections and terminal value calculations.
4---
5
6# DCF Model Builder
7

DCF Model Builder

Raw lines 1 to 7
8## Overview
9
10This skill creates institutional-quality DCF models for equity valuation following investment banking standards. Each analysis produces a detailed Excel model (with sensitivity analysis included at the bottom of the DCF sheet).

Overview

This skill creates institutional-quality DCF models for equity valuation following investment banking standards. Each analysis produces a detailed Excel model (with sensitivity analysis included at the bottom of the DCF sheet).

Raw lines 8 to 11
12## Tools
14- Default to using all of the information provided by the user and MCP servers available for data sourcing.

Tools

  • Default to using all of the information provided by the user and MCP servers available for data sourcing.
Raw lines 12 to 15
Uses an outside tool MCP :14
16## Critical Constraints - Read These First
18These constraints apply throughout all DCF model building. Review before starting:
20**Environment: Office JS vs Python/openpyxl:**
21- **If running inside Excel (Office Add-in / Office JS environment):** Use Office JS directly — do NOT use Python/openpyxl. Write formulas via `range.formulas = [["=D19*(1+$B$8)"]]`. No separate recalc step needed; Excel calculates natively. Use `range.format.*` for styling. The same formulas-over-hardcodes rule applies: set `.formulas`, never `.values` for derived cells.
22- **If generating a standalone .xlsx file (no live Excel session):** Use Python/openpyxl as described below, then run `recalc.py` before delivery.
23- The rest of this skill uses openpyxl examples — translate to Office JS API calls when in that environment, but all principles (formula strings, cell comments, section checkpoints, sensitivity table loops) apply identically.
25**⚠️ Office JS merged cell pitfall:** When building section headers with merged cells, do NOT call `.merge()` then set `.values` on the merged range — Office JS still reports the range's original dimensions and will throw `InvalidArgument: The number of rows or columns in the input array doesn't match the size or dimensions of the range`. Instead, write the value to the top-left cell alone, then merge and format the full range:
27```js
28// WRONG — throws InvalidArgument:
29const hdr = ws.getRange("A7:H7");
30hdr.merge();
31hdr.values = [["MARKET DATA & KEY INPUTS"]]; // 1×1 array vs 1×8 range → fails
33// CORRECT — value first on single cell, then merge + format the range:
34ws.getRange("A7").values = [["MARKET DATA & KEY INPUTS"]];
35const hdr = ws.getRange("A7:H7");
36hdr.merge();
37hdr.format.fill.color = "#1F4E79";
38hdr.format.font.bold = true;
39hdr.format.font.color = "#FFFFFF";
40```
42This applies to every merged section header in the DCF (market data, scenario blocks, cash flow projection, terminal value, valuation summary, sensitivity tables).
44**Formulas Over Hardcodes (NON-NEGOTIABLE):**
45- Every projection, margin, discount factor, PV, and sensitivity cell MUST be a live Excel formula — never a value computed in Python and written as a number
46- When using openpyxl: `ws["D20"] = "=D19*(1+$B$8)"` is correct; `ws["D20"] = calculated_revenue` is WRONG
47- The only hardcoded numbers permitted are: (1) raw historical inputs, (2) assumption drivers (growth rates, WACC inputs, terminal g), (3) current market data (share price, debt balance)
48- If you catch yourself computing something in Python and writing the result — STOP. The model must flex when the user changes an assumption.
50**Verify Step-by-Step With the User (DO NOT build end-to-end):**
51- After data retrieval → show the user the raw inputs block (revenue, margins, shares, net debt) and confirm before projecting
52- After revenue projections → show the projected top line and growth rates, confirm before building margin build
53- After FCF build → show the full FCF schedule, confirm logic before computing WACC
54- After WACC → show the calculation and inputs, confirm before discounting
55- After terminal value + PV → show the equity bridge (EV → equity value → per share), confirm before sensitivity tables
56- Catch errors at each stage — a wrong margin assumption discovered after sensitivity tables are built means rebuilding everything downstream
58**Sensitivity Tables:**
59- **Use an ODD number of rows and columns** (standard: 5×5, sometimes 7×7) — this guarantees a true center cell
60- **Center cell = base case.** Build the axis values so the middle row header and middle column header exactly equal the model's actual assumptions (e.g., if base WACC = 9.0%, the middle row is 9.0%; if terminal g = 3.0%, the middle column is 3.0%). The center cell's output must therefore equal the model's actual implied share price — this is the sanity check that the table is built correctly.
61- **Highlight the center cell** with the medium-blue fill (`#BDD7EE`) + bold font so it's immediately visible which cell is the base case.
62- Populate ALL cells (typically 3 tables × 25 cells = 75) with full DCF recalculation formulas
63- Use openpyxl loops (or Office JS loops) to write formulas programmatically
64- NO placeholder text, NO linear approximations, NO manual steps required
65- Each cell must recalculate full DCF for that assumption combination
67**Cell Comments:**
68- Add cell comments AS each hardcoded value is created
69- Format: "Source: [System/Document], [Date], [Reference], [URL if applicable]"
70- Every blue input must have a comment before moving to next section
71- Do not defer to end or write "TODO: add source"
73**Model Layout Planning:**
74- Define ALL section row positions BEFORE writing any formulas
75- Write ALL headers and labels first
76- Write ALL section dividers and blank rows second
77- THEN write formulas using the locked row positions
78- Test formulas immediately after creation
80**Formula Recalculation:**
81- Run `python recalc.py model.xlsx 30` before delivery
82- Fix ALL errors until status is "success"
83- Zero formula errors required (#REF!, #DIV/0!, #VALUE!, etc.)
85**Scenario Blocks:**
86- Create separate blocks for Bear/Base/Bull cases
87- Show assumptions horizontally across projection years within each block
88- Use IF formulas: `=IF($B$6=1,[Bear cell],IF($B$6=2,[Base cell],[Bull cell]))`
89- Verify formulas reference correct scenario block cells

Critical Constraints - Read These First

These constraints apply throughout all DCF model building. Review before starting:

Environment: Office JS vs Python/openpyxl:

  • If running inside Excel (Office Add-in / Office JS environment): Use Office JS directly — do NOT use Python/openpyxl. Write formulas via range.formulas = [["=D19*(1+$B$8)"]]. No separate recalc step needed; Excel calculates natively. Use range.format.* for styling. The same formulas-over-hardcodes rule applies: set .formulas, never .values for derived cells.
  • If generating a standalone .xlsx file (no live Excel session): Use Python/openpyxl as described below, then run recalc.py before delivery.
  • The rest of this skill uses openpyxl examples — translate to Office JS API calls when in that environment, but all principles (formula strings, cell comments, section checkpoints, sensitivity table loops) apply identically.

⚠️ Office JS merged cell pitfall: When building section headers with merged cells, do NOT call .merge() then set .values on the merged range — Office JS still reports the range's original dimensions and will throw InvalidArgument: The number of rows or columns in the input array doesn't match the size or dimensions of the range. Instead, write the value to the top-left cell alone, then merge and format the full range:

// WRONG — throws InvalidArgument:
const hdr = ws.getRange("A7:H7");
hdr.merge();
hdr.values = [["MARKET DATA & KEY INPUTS"]];  // 1×1 array vs 1×8 range → fails

// CORRECT — value first on single cell, then merge + format the range:
ws.getRange("A7").values = [["MARKET DATA & KEY INPUTS"]];
const hdr = ws.getRange("A7:H7");
hdr.merge();
hdr.format.fill.color = "#1F4E79";
hdr.format.font.bold = true;
hdr.format.font.color = "#FFFFFF";

This applies to every merged section header in the DCF (market data, scenario blocks, cash flow projection, terminal value, valuation summary, sensitivity tables).

Formulas Over Hardcodes (NON-NEGOTIABLE):

  • Every projection, margin, discount factor, PV, and sensitivity cell MUST be a live Excel formula — never a value computed in Python and written as a number
  • When using openpyxl: ws["D20"] = "=D19*(1+$B$8)" is correct; ws["D20"] = calculated_revenue is WRONG
  • The only hardcoded numbers permitted are: (1) raw historical inputs, (2) assumption drivers (growth rates, WACC inputs, terminal g), (3) current market data (share price, debt balance)
  • If you catch yourself computing something in Python and writing the result — STOP. The model must flex when the user changes an assumption.

Verify Step-by-Step With the User (DO NOT build end-to-end):

  • After data retrieval → show the user the raw inputs block (revenue, margins, shares, net debt) and confirm before projecting
  • After revenue projections → show the projected top line and growth rates, confirm before building margin build
  • After FCF build → show the full FCF schedule, confirm logic before computing WACC
  • After WACC → show the calculation and inputs, confirm before discounting
  • After terminal value + PV → show the equity bridge (EV → equity value → per share), confirm before sensitivity tables
  • Catch errors at each stage — a wrong margin assumption discovered after sensitivity tables are built means rebuilding everything downstream

Sensitivity Tables:

  • Use an ODD number of rows and columns (standard: 5×5, sometimes 7×7) — this guarantees a true center cell
  • Center cell = base case. Build the axis values so the middle row header and middle column header exactly equal the model's actual assumptions (e.g., if base WACC = 9.0%, the middle row is 9.0%; if terminal g = 3.0%, the middle column is 3.0%). The center cell's output must therefore equal the model's actual implied share price — this is the sanity check that the table is built correctly.
  • Highlight the center cell with the medium-blue fill (#BDD7EE) + bold font so it's immediately visible which cell is the base case.
  • Populate ALL cells (typically 3 tables × 25 cells = 75) with full DCF recalculation formulas
  • Use openpyxl loops (or Office JS loops) to write formulas programmatically
  • NO placeholder text, NO linear approximations, NO manual steps required
  • Each cell must recalculate full DCF for that assumption combination

Cell Comments:

  • Add cell comments AS each hardcoded value is created
  • Format: "Source: [System/Document], [Date], [Reference], [URL if applicable]"
  • Every blue input must have a comment before moving to next section
  • Do not defer to end or write "TODO: add source"

Model Layout Planning:

  • Define ALL section row positions BEFORE writing any formulas
  • Write ALL headers and labels first
  • Write ALL section dividers and blank rows second
  • THEN write formulas using the locked row positions
  • Test formulas immediately after creation

Formula Recalculation:

  • Run python recalc.py model.xlsx 30 before delivery
  • Fix ALL errors until status is "success"
  • Zero formula errors required (#REF!, #DIV/0!, #VALUE!, etc.)

Scenario Blocks:

  • Create separate blocks for Bear/Base/Bull cases
  • Show assumptions horizontally across projection years within each block
  • Use IF formulas: =IF($B$6=1,[Bear cell],IF($B$6=2,[Base cell],[Bull cell]))
  • Verify formulas reference correct scenario block cells
Raw lines 16 to 90
Runs code python recalc.py :81
91## DCF Process Workflow

DCF Process Workflow

Raw lines 91 to 92
93### Step 1: Data Retrieval and Validation
95Fetch data from MCP servers, user provided data, and the web.
97**Data Sources Priority:**
981. **MCP Servers** (if configured) - Structured financial data from providers like Daloopa
992. **User-Provided Data** - Historical financials from their research
1003. **Web Search/Fetch** - Current prices, beta, debt and cash when needed
102**Validation Checklist:**
103- Verify net debt vs net cash (critical for valuation)
104- Confirm diluted shares outstanding (check for recent buybacks/issuances)
105- Validate historical margins are consistent with business model
106- Cross-check revenue growth rates with industry benchmarks
107- Verify tax rate is reasonable (typically 21-28%)

Step 1: Data Retrieval and Validation

Fetch data from MCP servers, user provided data, and the web.

Data Sources Priority:

  1. MCP Servers (if configured) - Structured financial data from providers like Daloopa
  2. User-Provided Data - Historical financials from their research
  3. Web Search/Fetch - Current prices, beta, debt and cash when needed

Validation Checklist:

  • Verify net debt vs net cash (critical for valuation)
  • Confirm diluted shares outstanding (check for recent buybacks/issuances)
  • Validate historical margins are consistent with business model
  • Cross-check revenue growth rates with industry benchmarks
  • Verify tax rate is reasonable (typically 21-28%)
Raw lines 93 to 108
Uses an outside tool MCP :95
109### Step 2: Historical Analysis (3-5 years)
111Analyze and document:
112- **Revenue growth trends**: Calculate CAGR, identify drivers
113- **Margin progression**: Track gross margin, EBIT margin, FCF margin
114- **Capital intensity**: D&A and CapEx as % of revenue
115- **Working capital efficiency**: NWC changes as % of revenue growth
116- **Return metrics**: ROIC, ROE trends
118Create summary tables showing:
119```
120Historical Metrics (LTM):
121Revenue: $X million
122Revenue growth: X% CAGR
123Gross margin: X%
124EBIT margin: X%
125D&A % of revenue: X%
126CapEx % of revenue: X%
127FCF margin: X%
128```

Step 2: Historical Analysis (3-5 years)

Analyze and document:

  • Revenue growth trends: Calculate CAGR, identify drivers
  • Margin progression: Track gross margin, EBIT margin, FCF margin
  • Capital intensity: D&A and CapEx as % of revenue
  • Working capital efficiency: NWC changes as % of revenue growth
  • Return metrics: ROIC, ROE trends

Create summary tables showing:

Historical Metrics (LTM):
Revenue: $X million
Revenue growth: X% CAGR
Gross margin: X%
EBIT margin: X%
D&A % of revenue: X%
CapEx % of revenue: X%
FCF margin: X%
Raw lines 109 to 129
130### Step 3: Build Revenue Projections
132**Methodology:**
1331. Start with latest actual revenue (LTM or most recent fiscal year)
1342. Apply growth rates for each projection year
1353. Show both dollar amounts AND calculated growth %
137**Growth Rate Framework:**
138- Year 1-2: Higher growth reflecting near-term visibility
139- Year 3-4: Gradual moderation toward industry average
140- Year 5+: Approaching terminal growth rate
142**Formula structure:**
143- Revenue(Year N) = Revenue(Year N-1) × (1 + Growth Rate)
144- Growth %(Year N) = Revenue(Year N) / Revenue(Year N-1) - 1
146**Three-scenario approach:**
147```
148Bear Case: Conservative growth (e.g., 8-12%)
149Base Case: Most likely scenario (e.g., 12-16%)
150Bull Case: Optimistic growth (e.g., 16-20%)
151```

Step 3: Build Revenue Projections

Methodology:

  1. Start with latest actual revenue (LTM or most recent fiscal year)
  2. Apply growth rates for each projection year
  3. Show both dollar amounts AND calculated growth %

Growth Rate Framework:

  • Year 1-2: Higher growth reflecting near-term visibility
  • Year 3-4: Gradual moderation toward industry average
  • Year 5+: Approaching terminal growth rate

Formula structure:

  • Revenue(Year N) = Revenue(Year N-1) × (1 + Growth Rate)
  • Growth %(Year N) = Revenue(Year N) / Revenue(Year N-1) - 1

Three-scenario approach:

Bear Case: Conservative growth (e.g., 8-12%)
Base Case: Most likely scenario (e.g., 12-16%)
Bull Case: Optimistic growth (e.g., 16-20%)
Raw lines 130 to 152
153### Step 4: Operating Expense Modeling
155**Fixed/Variable Cost Analysis:**
157Operating expenses should model realistic operating leverage:
158- **Sales & Marketing**: Typically 15-40% of revenue depending on business model
159- **Research & Development**: Typically 10-30% for technology companies
160- **General & Administrative**: Typically 8-15% of revenue, shows leverage as company scales
162**Key principles:**
163- ALL percentages based on REVENUE, not gross profit
164- Model operating leverage: % should decline as revenue scales
165- Maintain separate line items for S&M, R&D, G&A
166- Calculate EBIT = Gross Profit - Total OpEx
168**Margin expansion framework:**
169```
170Current State → Target State (Year 5)
171Gross Margin: X% → Y% (justify based on scale, efficiency)
172EBIT Margin: X% → Y% (result of revenue growth + opex leverage)
173```

Step 4: Operating Expense Modeling

Fixed/Variable Cost Analysis:

Operating expenses should model realistic operating leverage:

  • Sales & Marketing: Typically 15-40% of revenue depending on business model
  • Research & Development: Typically 10-30% for technology companies
  • General & Administrative: Typically 8-15% of revenue, shows leverage as company scales

Key principles:

  • ALL percentages based on REVENUE, not gross profit
  • Model operating leverage: % should decline as revenue scales
  • Maintain separate line items for S&M, R&D, G&A
  • Calculate EBIT = Gross Profit - Total OpEx

Margin expansion framework:

Current State → Target State (Year 5)
Gross Margin: X% → Y% (justify based on scale, efficiency)
EBIT Margin: X% → Y% (result of revenue growth + opex leverage)
Raw lines 153 to 174
175### Step 5: Free Cash Flow Calculation
177**Build FCF in proper sequence:**
179```
180EBIT
181(-) Taxes (EBIT × Tax Rate)
182= NOPAT (Net Operating Profit After Tax)
183(+) D&A (non-cash expense, % of revenue)
184(-) CapEx (% of revenue, typically 4-8%)
185(-) Δ NWC (change in working capital)
186= Unlevered Free Cash Flow
187```
189**Working Capital Modeling:**
190- Calculate as % of revenue change (delta revenue)
191- Typical range: -2% to +2% of revenue change
192- Negative number = source of cash (working capital release)
193- Positive number = use of cash (working capital build)
195**Maintenance vs Growth CapEx:**
196- Maintenance CapEx: Sustains current operations (~2-3% revenue)
197- Growth CapEx: Supports expansion (additional 2-5% revenue)
198- Total CapEx should align with company's growth strategy

Step 5: Free Cash Flow Calculation

Build FCF in proper sequence:

EBIT
(-) Taxes (EBIT × Tax Rate)
= NOPAT (Net Operating Profit After Tax)
(+) D&A (non-cash expense, % of revenue)
(-) CapEx (% of revenue, typically 4-8%)
(-) Δ NWC (change in working capital)
= Unlevered Free Cash Flow

Working Capital Modeling:

  • Calculate as % of revenue change (delta revenue)
  • Typical range: -2% to +2% of revenue change
  • Negative number = source of cash (working capital release)
  • Positive number = use of cash (working capital build)

Maintenance vs Growth CapEx:

  • Maintenance CapEx: Sustains current operations (~2-3% revenue)
  • Growth CapEx: Supports expansion (additional 2-5% revenue)
  • Total CapEx should align with company's growth strategy
Raw lines 175 to 199
200### Step 6: Cost of Capital (WACC) Research
202**CAPM Methodology for Cost of Equity:**
204```
205Cost of Equity = Risk-Free Rate + Beta × Equity Risk Premium
207Where:
208- Risk-Free Rate = Current 10-Year Treasury Yield
209- Beta = 5-year monthly stock beta vs market index
210- Equity Risk Premium = 5.0-6.0% (market standard)
211```
213**Cost of Debt Calculation:**
215```
216After-Tax Cost of Debt = Pre-Tax Cost of Debt × (1 - Tax Rate)
218Determine Pre-Tax Cost of Debt from:
219- Credit rating (if available)
220- Current yield on company bonds
221- Interest expense / Total Debt from financials
222```
224**Capital Structure Weights:**
226```
227Market Value Equity = Current Stock Price × Shares Outstanding
228Net Debt = Total Debt - Cash & Equivalents
229Enterprise Value = Market Cap + Net Debt
231Equity Weight = Market Cap / Enterprise Value
232Debt Weight = Net Debt / Enterprise Value
234WACC = (Cost of Equity × Equity Weight) + (After-Tax Cost of Debt × Debt Weight)
235```
237**Special Cases:**
238- **Net Cash Position**: If Cash > Debt, Net Debt is NEGATIVE
239 - Debt Weight may be negative
240 - WACC calculation adjusts accordingly
241- **No Debt**: WACC = Cost of Equity
243**Typical WACC Ranges:**
244- Large Cap, Stable: 7-9%
245- Growth Companies: 9-12%
246- High Growth/Risk: 12-15%

Step 6: Cost of Capital (WACC) Research

CAPM Methodology for Cost of Equity:

Cost of Equity = Risk-Free Rate + Beta × Equity Risk Premium

Where:
- Risk-Free Rate = Current 10-Year Treasury Yield
- Beta = 5-year monthly stock beta vs market index
- Equity Risk Premium = 5.0-6.0% (market standard)

Cost of Debt Calculation:

After-Tax Cost of Debt = Pre-Tax Cost of Debt × (1 - Tax Rate)

Determine Pre-Tax Cost of Debt from:
- Credit rating (if available)
- Current yield on company bonds
- Interest expense / Total Debt from financials

Capital Structure Weights:

Market Value Equity = Current Stock Price × Shares Outstanding
Net Debt = Total Debt - Cash & Equivalents
Enterprise Value = Market Cap + Net Debt

Equity Weight = Market Cap / Enterprise Value
Debt Weight = Net Debt / Enterprise Value

WACC = (Cost of Equity × Equity Weight) + (After-Tax Cost of Debt × Debt Weight)

Special Cases:

  • Net Cash Position: If Cash > Debt, Net Debt is NEGATIVE
  • Debt Weight may be negative
  • WACC calculation adjusts accordingly
  • No Debt: WACC = Cost of Equity

Typical WACC Ranges:

  • Large Cap, Stable: 7-9%
  • Growth Companies: 9-12%
  • High Growth/Risk: 12-15%
Raw lines 200 to 247
248### Step 7: Discount Rate Application (5-10 Year Forecast)
250**Mid-Year Convention:**
251- Cash flows assumed to occur mid-year
252- Discount Period: 0.5, 1.5, 2.5, 3.5, 4.5, etc.
253- Discount Factor = 1 / (1 + WACC)^Period
255**Present Value Calculation:**
256```
257For each projection year:
258PV of FCF = Unlevered FCF × Discount Factor
260Example (Year 1):
261FCF = $1,000
262WACC = 10%
263Period = 0.5
264Discount Factor = 1 / (1.10)^0.5 = 0.9535
265PV = $1,000 × 0.9535 = $954
266```
268**Projection Period Selection:**
269- **5 years**: Standard for most analyses
270- **7-10 years**: High growth companies with longer runway
271- **3 years**: Mature, stable businesses

Step 7: Discount Rate Application (5-10 Year Forecast)

Mid-Year Convention:

  • Cash flows assumed to occur mid-year
  • Discount Period: 0.5, 1.5, 2.5, 3.5, 4.5, etc.
  • Discount Factor = 1 / (1 + WACC)^Period

Present Value Calculation:

For each projection year:
PV of FCF = Unlevered FCF × Discount Factor

Example (Year 1):
FCF = $1,000
WACC = 10%
Period = 0.5
Discount Factor = 1 / (1.10)^0.5 = 0.9535
PV = $1,000 × 0.9535 = $954

Projection Period Selection:

  • 5 years: Standard for most analyses
  • 7-10 years: High growth companies with longer runway
  • 3 years: Mature, stable businesses
Raw lines 248 to 272
273### Step 8: Terminal Value Calculation
275**Perpetuity Growth Method (Preferred):**
277```
278Terminal FCF = Final Year FCF × (1 + Terminal Growth Rate)
279Terminal Value = Terminal FCF / (WACC - Terminal Growth Rate)
281Critical Constraint: Terminal Growth < WACC (otherwise infinite value)
282```
284**Terminal Growth Rate Selection:**
285- Conservative: 2.0-2.5% (GDP growth rate)
286- Moderate: 2.5-3.5%
287- Aggressive: 3.5-5.0% (only for market leaders)
289**Do not exceed**: Risk-free rate or long-term GDP growth
291**Exit Multiple Method (Alternative):**
292```
293Terminal Value = Final Year EBITDA × Exit Multiple
295Where Exit Multiple comes from:
296- Industry comparable trading multiples
297- Precedent transaction multiples
298- Typical range: 8-15x EBITDA
299```
301**Present Value of Terminal Value:**
302```
303PV of Terminal Value = Terminal Value / (1 + WACC)^Final Period
305Where Final Period accounts for timing:
3065-year model with mid-year convention: Period = 4.5
307```
309**Terminal Value Sanity Check:**
310- Should represent 50-70% of Enterprise Value
311- If >75%, model may be over-reliant on terminal assumptions
312- If <40%, check if terminal assumptions are too conservative

Step 8: Terminal Value Calculation

Perpetuity Growth Method (Preferred):

Terminal FCF = Final Year FCF × (1 + Terminal Growth Rate)
Terminal Value = Terminal FCF / (WACC - Terminal Growth Rate)

Critical Constraint: Terminal Growth < WACC (otherwise infinite value)

Terminal Growth Rate Selection:

  • Conservative: 2.0-2.5% (GDP growth rate)
  • Moderate: 2.5-3.5%
  • Aggressive: 3.5-5.0% (only for market leaders)

Do not exceed: Risk-free rate or long-term GDP growth

Exit Multiple Method (Alternative):

Terminal Value = Final Year EBITDA × Exit Multiple

Where Exit Multiple comes from:
- Industry comparable trading multiples
- Precedent transaction multiples
- Typical range: 8-15x EBITDA

Present Value of Terminal Value:

PV of Terminal Value = Terminal Value / (1 + WACC)^Final Period

Where Final Period accounts for timing:
5-year model with mid-year convention: Period = 4.5

Terminal Value Sanity Check:

  • Should represent 50-70% of Enterprise Value
  • If >75%, model may be over-reliant on terminal assumptions
  • If <40%, check if terminal assumptions are too conservative
Raw lines 273 to 313
314### Step 9: Enterprise to Equity Value Bridge
316**Valuation Summary Structure:**
318```
319(+) Sum of PV of Projected FCFs = $X million
320(+) PV of Terminal Value = $Y million
321= Enterprise Value = $Z million
323(-) Net Debt [or + Net Cash if negative] = $A million
324= Equity Value = $B million
326÷ Diluted Shares Outstanding = C million shares
327= Implied Price per Share = $XX.XX
329Current Stock Price = $YY.YY
330Implied Return = (Implied Price / Current Price) - 1 = XX%
331```
333**Critical Adjustments:**
334- **Net Debt = Total Debt - Cash & Equivalents**
335 - If positive: Subtract from EV (reduces equity value)
336 - If negative (Net Cash): Add to EV (increases equity value)
337- **Use Diluted Shares**: Includes options, RSUs, convertible securities
338- **Other adjustments** (if applicable):
339 - Minority interests
340 - Pension liabilities
341 - Operating lease obligations
343**Valuation Output Format:**
344```csv
345Valuation Component,Amount ($M)
346PV Explicit FCFs,X.X
347PV Terminal Value,Y.Y
348Enterprise Value,Z.Z
349(-) Net Debt,A.A
350Equity Value,B.B
351,,
352Shares Outstanding (M),C.C
353Implied Price per Share,$XX.XX
354Current Share Price,$YY.YY
355Implied Upside/(Downside),+XX%
356```

Step 9: Enterprise to Equity Value Bridge

Valuation Summary Structure:

(+) Sum of PV of Projected FCFs = $X million
(+) PV of Terminal Value = $Y million
= Enterprise Value = $Z million

(-) Net Debt [or + Net Cash if negative] = $A million
= Equity Value = $B million

÷ Diluted Shares Outstanding = C million shares
= Implied Price per Share = $XX.XX

Current Stock Price = $YY.YY
Implied Return = (Implied Price / Current Price) - 1 = XX%

Critical Adjustments:

  • Net Debt = Total Debt - Cash & Equivalents
  • If positive: Subtract from EV (reduces equity value)
  • If negative (Net Cash): Add to EV (increases equity value)
  • Use Diluted Shares: Includes options, RSUs, convertible securities
  • Other adjustments (if applicable):
  • Minority interests
  • Pension liabilities
  • Operating lease obligations

Valuation Output Format:

Valuation Component,Amount ($M)
PV Explicit FCFs,X.X
PV Terminal Value,Y.Y
Enterprise Value,Z.Z
(-) Net Debt,A.A
Equity Value,B.B
,,
Shares Outstanding (M),C.C
Implied Price per Share,$XX.XX
Current Share Price,$YY.YY
Implied Upside/(Downside),+XX%
Raw lines 314 to 357
358### Step 10: Sensitivity Analysis
360Build **three sensitivity tables** at the bottom of the DCF sheet showing how valuation changes with different assumptions:
3621. **WACC vs Terminal Growth** - Shows enterprise value sensitivity to discount rate and perpetuity growth
3632. **Revenue Growth vs EBIT Margin** - Shows impact of top-line growth and operating leverage
3643. **Beta vs Risk-Free Rate** - Shows sensitivity to cost of equity components
366**Implementation**: These are simple 2D grids (NOT Excel's "Data Table" feature) with formulas in each cell. Each cell must contain a full DCF recalculation for that specific assumption combination. See Critical Constraints section for detailed requirements on populating all 75 cells programmatically using openpyxl.
368<correct_patterns>
370This section contains all the CORRECT patterns to follow when building DCF models.

Step 10: Sensitivity Analysis

Build three sensitivity tables at the bottom of the DCF sheet showing how valuation changes with different assumptions:

  1. WACC vs Terminal Growth - Shows enterprise value sensitivity to discount rate and perpetuity growth
  2. Revenue Growth vs EBIT Margin - Shows impact of top-line growth and operating leverage
  3. Beta vs Risk-Free Rate - Shows sensitivity to cost of equity components

Implementation: These are simple 2D grids (NOT Excel's "Data Table" feature) with formulas in each cell. Each cell must contain a full DCF recalculation for that specific assumption combination. See Critical Constraints section for detailed requirements on populating all 75 cells programmatically using openpyxl.

<correct_patterns>

This section contains all the CORRECT patterns to follow when building DCF models.

Raw lines 358 to 371
372### Scenario Block Selection Pattern - Follow This Approach
374**Assumptions are organized in separate blocks for each scenario:**
376**CRITICAL STRUCTURE - Three rows per section header:**
378```csv
379BEAR CASE ASSUMPTIONS (section header, merge cells across)
380Assumption,FY1,FY2,FY3,FY4,FY5
381Revenue Growth (%),12%,10%,9%,8%,7%
382EBIT Margin (%),45%,44%,43%,42%,41%
384BASE CASE ASSUMPTIONS (section header, merge cells across)
385Assumption,FY1,FY2,FY3,FY4,FY5
386Revenue Growth (%),16%,14%,12%,10%,9%
387EBIT Margin (%),48%,49%,50%,51%,52%
389BULL CASE ASSUMPTIONS (section header, merge cells across)
390Assumption,FY1,FY2,FY3,FY4,FY5
391Revenue Growth (%),20%,18%,15%,13%,11%
392EBIT Margin (%),50%,51%,52%,53%,54%
393```
395**Each scenario block MUST have a column header row** showing the projection years (FY2025E, FY2026E, etc.) immediately below the section title. Without this, users cannot tell which assumption value corresponds to which year.
397**How to reference assumptions - Create a consolidation column:**
3981. Case selector cell (e.g., B6) contains 1=Bear, 2=Base, or 3=Bull
3992. Create a consolidation column with INDEX or OFFSET formulas to pull from the correct scenario block
4003. Projection formulas reference the consolidation column (clean cell references)
4014. Each scenario block contains full set of DCF assumptions across projection years
403**Recommended consolidation column pattern (using INDEX):**
404`=INDEX(B10:D10, 1, $B$6)`
406**NOT this - scattered IF statements throughout:**
407`=IF($B$6=1,[Bear block cell],IF($B$6=2,[Base block cell],[Bull block cell]))`
409The consolidation column approach centralizes logic and makes the model easier to audit.

Scenario Block Selection Pattern - Follow This Approach

Assumptions are organized in separate blocks for each scenario:

CRITICAL STRUCTURE - Three rows per section header:

BEAR CASE ASSUMPTIONS (section header, merge cells across)
Assumption,FY1,FY2,FY3,FY4,FY5
Revenue Growth (%),12%,10%,9%,8%,7%
EBIT Margin (%),45%,44%,43%,42%,41%

BASE CASE ASSUMPTIONS (section header, merge cells across)
Assumption,FY1,FY2,FY3,FY4,FY5
Revenue Growth (%),16%,14%,12%,10%,9%
EBIT Margin (%),48%,49%,50%,51%,52%

BULL CASE ASSUMPTIONS (section header, merge cells across)
Assumption,FY1,FY2,FY3,FY4,FY5
Revenue Growth (%),20%,18%,15%,13%,11%
EBIT Margin (%),50%,51%,52%,53%,54%

Each scenario block MUST have a column header row showing the projection years (FY2025E, FY2026E, etc.) immediately below the section title. Without this, users cannot tell which assumption value corresponds to which year.

How to reference assumptions - Create a consolidation column:

  1. Case selector cell (e.g., B6) contains 1=Bear, 2=Base, or 3=Bull
  2. Create a consolidation column with INDEX or OFFSET formulas to pull from the correct scenario block
  3. Projection formulas reference the consolidation column (clean cell references)
  4. Each scenario block contains full set of DCF assumptions across projection years

Recommended consolidation column pattern (using INDEX): =INDEX(B10:D10, 1, $B$6)

NOT this - scattered IF statements throughout: =IF($B$6=1,[Bear block cell],IF($B$6=2,[Base block cell],[Bull block cell]))

The consolidation column approach centralizes logic and makes the model easier to audit.

Raw lines 372 to 410
411### Correct Revenue Projection Pattern
413**Create a consolidation column with INDEX formulas, then reference it in projections:**
415**Step 1 - Consolidation column for FY1 growth:**
416`=INDEX([Bear FY1 growth]:[Bull FY1 growth], 1, $B$6)`
418**Step 2 - Revenue projection references the consolidation column:**
419`Revenue Year 1: =D29*(1+$E$10)`
421Where:
422- D29 = Prior year revenue
423- $E$10 = Consolidation column cell for FY1 growth (contains INDEX formula)
424- $B$6 = Case selector (1=Bear, 2=Base, 3=Bull)
426**This approach is cleaner than embedding IF statements in every projection formula** and makes it much easier to audit which scenario assumptions are being used.

Correct Revenue Projection Pattern

Create a consolidation column with INDEX formulas, then reference it in projections:

Step 1 - Consolidation column for FY1 growth: =INDEX([Bear FY1 growth]:[Bull FY1 growth], 1, $B$6)

Step 2 - Revenue projection references the consolidation column: Revenue Year 1: =D29*(1+$E$10)

Where:

  • D29 = Prior year revenue
  • $E$10 = Consolidation column cell for FY1 growth (contains INDEX formula)
  • $B$6 = Case selector (1=Bear, 2=Base, 3=Bull)

This approach is cleaner than embedding IF statements in every projection formula and makes it much easier to audit which scenario assumptions are being used.

Raw lines 411 to 427
428### Correct FCF Formula Pattern
430**Use consolidation columns with INDEX formulas, then reference them in FCF calculations:**
432**Consolidation column approach:**
433```csv
434Item,Formula,Reference
435D&A,=E29*$E$21,$E$21 = consolidation column for D&A %
436CapEx,=E29*$E$22,$E$22 = consolidation column for CapEx %
437Δ NWC,=(E29-D29)*$E$23,$E$23 = consolidation column for NWC %
438Unlevered FCF,=E57+E58-E60-E62,E57=NOPAT E58=D&A E60=CapEx E62=Δ NWC
439```
441**Each consolidation column cell contains an INDEX formula** that pulls from the appropriate scenario block based on case selector. This keeps projection formulas clean and auditable.
443Before writing formulas, confirm scenario block row locations and set up consolidation columns.

Correct FCF Formula Pattern

Use consolidation columns with INDEX formulas, then reference them in FCF calculations:

Consolidation column approach:

Item,Formula,Reference
D&A,=E29*$E$21,$E$21 = consolidation column for D&A %
CapEx,=E29*$E$22,$E$22 = consolidation column for CapEx %
Δ NWC,=(E29-D29)*$E$23,$E$23 = consolidation column for NWC %
Unlevered FCF,=E57+E58-E60-E62,E57=NOPAT E58=D&A E60=CapEx E62=Δ NWC

Each consolidation column cell contains an INDEX formula that pulls from the appropriate scenario block based on case selector. This keeps projection formulas clean and auditable.

Before writing formulas, confirm scenario block row locations and set up consolidation columns.

Raw lines 428 to 444
445### Correct Cell Comment Format
447**Every hardcoded value needs this format:**
449"Source: [System/Document], [Date], [Reference], [URL if applicable]"
451**Examples:**
452```csv
453Item,Source Comment
454Stock price,Source: Market data script 2025-10-12 Close price
455Shares outstanding,Source: 10-K FY2024 Page 45 Note 12
456Historical revenue,Source: 10-K FY2024 Page 32 Consolidated Statements
457Beta,Source: Market data script 2025-10-12 5-year monthly beta
458Consensus estimates,Source: Management guidance Q3 2024 earnings call
459```

Correct Cell Comment Format

Every hardcoded value needs this format:

"Source: [System/Document], [Date], [Reference], [URL if applicable]"

Examples:

Item,Source Comment
Stock price,Source: Market data script 2025-10-12 Close price
Shares outstanding,Source: 10-K FY2024 Page 45 Note 12
Historical revenue,Source: 10-K FY2024 Page 32 Consolidated Statements
Beta,Source: Market data script 2025-10-12 5-year monthly beta
Consensus estimates,Source: Management guidance Q3 2024 earnings call
Raw lines 445 to 460
461### Correct Assumption Table Structure
463**CRITICAL: Each scenario block requires THREE structural elements:**
4651. **Section header row** (merged cells): e.g., "BEAR CASE ASSUMPTIONS"
4662. **Column header row** showing years - THIS IS REQUIRED, DO NOT SKIP
4673. **Data rows** with assumption values
469**Structure:**
470```csv
471BEAR CASE ASSUMPTIONS (section header - merge across columns A:G)
472Assumption,FY1,FY2,FY3,FY4,FY5
473Revenue Growth (%),X%,X%,X%,X%,X%
474EBIT Margin (%),X%,X%,X%,X%,X%
475Terminal Growth,X%,,,,
476WACC,X%,,,,
478BASE CASE ASSUMPTIONS (section header - merge across columns A:G)
479Assumption,FY1,FY2,FY3,FY4,FY5
480Revenue Growth (%),X%,X%,X%,X%,X%
481EBIT Margin (%),X%,X%,X%,X%,X%
482Terminal Growth,X%,,,,
483WACC,X%,,,,
485BULL CASE ASSUMPTIONS (section header - merge across columns A:G)
486Assumption,FY1,FY2,FY3,FY4,FY5
487Revenue Growth (%),X%,X%,X%,X%,X%
488EBIT Margin (%),X%,X%,X%,X%,X%
489Terminal Growth,X%,,,,
490WACC,X%,,,,
491```
493**WITHOUT the column header row showing projection years (FY2025E, FY2026E, etc.), users cannot tell which assumption value corresponds to which year. This row is MANDATORY.**
495**Then create a consolidation column** (typically the next column to the right) that uses INDEX formulas to pull from the selected scenario block based on the case selector. This consolidation column is what your projection formulas reference.

Correct Assumption Table Structure

CRITICAL: Each scenario block requires THREE structural elements:

  1. Section header row (merged cells): e.g., "BEAR CASE ASSUMPTIONS"
  2. Column header row showing years - THIS IS REQUIRED, DO NOT SKIP
  3. Data rows with assumption values

Structure:

BEAR CASE ASSUMPTIONS (section header - merge across columns A:G)
Assumption,FY1,FY2,FY3,FY4,FY5
Revenue Growth (%),X%,X%,X%,X%,X%
EBIT Margin (%),X%,X%,X%,X%,X%
Terminal Growth,X%,,,,
WACC,X%,,,,

BASE CASE ASSUMPTIONS (section header - merge across columns A:G)
Assumption,FY1,FY2,FY3,FY4,FY5
Revenue Growth (%),X%,X%,X%,X%,X%
EBIT Margin (%),X%,X%,X%,X%,X%
Terminal Growth,X%,,,,
WACC,X%,,,,

BULL CASE ASSUMPTIONS (section header - merge across columns A:G)
Assumption,FY1,FY2,FY3,FY4,FY5
Revenue Growth (%),X%,X%,X%,X%,X%
EBIT Margin (%),X%,X%,X%,X%,X%
Terminal Growth,X%,,,,
WACC,X%,,,,

WITHOUT the column header row showing projection years (FY2025E, FY2026E, etc.), users cannot tell which assumption value corresponds to which year. This row is MANDATORY.

Then create a consolidation column (typically the next column to the right) that uses INDEX formulas to pull from the selected scenario block based on the case selector. This consolidation column is what your projection formulas reference.

Raw lines 461 to 496
497### Correct Row Planning Process
499**1. Write ALL headers and labels FIRST:**
500```csv
501Row,Content
5021,[Company Name] DCF Model
5032,Ticker | Date | Year End
5044,Case Selector
5057,KEY ASSUMPTIONS
50626,Assumption headers
50727-31,Growth assumptions
508...,...
509```
511**2. Write ALL section dividers and blank rows**
513**3. THEN write formulas using the locked row positions**
515**4. Test formulas immediately after creation**
517**Think of it like construction:**
518- Good: Pour foundation, then build walls (stable structure)
519- Bad: Build walls, then pour foundation (walls collapse)
521**Excel version:**
522- Good: Add headers, then write formulas (formulas stable)
523- Bad: Write formulas, then add headers (formulas break)

Correct Row Planning Process

1. Write ALL headers and labels FIRST:

Row,Content
1,[Company Name] DCF Model
2,Ticker | Date | Year End
4,Case Selector
7,KEY ASSUMPTIONS
26,Assumption headers
27-31,Growth assumptions
...,...

2. Write ALL section dividers and blank rows

3. THEN write formulas using the locked row positions

4. Test formulas immediately after creation

Think of it like construction:

  • Good: Pour foundation, then build walls (stable structure)
  • Bad: Build walls, then pour foundation (walls collapse)

Excel version:

  • Good: Add headers, then write formulas (formulas stable)
  • Bad: Write formulas, then add headers (formulas break)
Raw lines 497 to 524
525### Correct Sensitivity Table Implementation
527**IMPORTANT**: These are NOT Excel's "Data Table" feature. These are simple grids where you write regular formulas using openpyxl. Yes, this means ~75 formulas total (3 tables × 25 cells each), but this is straightforward and required.
529**Programmatic Population with Formulas:**
531Each sensitivity table must be fully populated with formulas that recalculate the implied share price for each combination of assumptions. **Do not use Excel's Data Table feature** (it requires manual intervention and cannot be automated via openpyxl).
533**Implementation approach - CONCRETE EXAMPLE:**
535**Table Structure — 5×5 grid (ODD dimensions, base case centered):**
537If the model's base WACC = 9.0% and base terminal growth = 3.0%, build the axes symmetrically around those values:
539```csv
540WACC vs Terminal Growth, 2.0%, 2.5%, 3.0%, 3.5%, 4.0%
541 8.0%, [fml], [fml], [fml], [fml], [fml]
542 8.5%, [fml], [fml], [fml], [fml], [fml]
543 9.0%, [fml], [fml], [★ ], [fml], [fml] ← middle row = base WACC
544 9.5%, [fml], [fml], [fml], [fml], [fml]
545 10.0%, [fml], [fml], [fml], [fml], [fml]
546 ↑
547 middle col = base terminal g
548```
550**★ = the center cell.** Its formula output MUST equal the model's actual implied share price (from the valuation summary). Apply the medium-blue fill (`#BDD7EE`) and bold font to this cell so the base case is visually anchored.
552**Rule for axis values:** `axis_values = [base - 2*step, base - step, base, base + step, base + 2*step]` — symmetric around the base, odd count guarantees a center.
554**Formula Pattern - Cell B88 (WACC=8.0%, Terminal Growth=2.0%):**
556The formula in B88 should recalculate the implied price using:
557- WACC from row header: `$A88` (8.0%)
558- Terminal Growth from column header: `B$87` (2.0%)
560**Recommended approach:** Reference the main DCF calculation but substitute these values.
562**Example formula structure:**
563`=([SUM of PV FCFs using $A88 as discount rate] + [Terminal Value using B$87 as growth rate and $A88 as WACC] - [Net Debt]) / [Shares]`
565**CRITICAL - Write a formula for EVERY cell in the 5x5 grid (25 cells per table, 75 cells total).** Use openpyxl to write these formulas programmatically in a loop. Do NOT skip this step or leave placeholder text.
567**Python implementation pattern:**
568```python
569# Pseudocode for populating sensitivity table
570for row_idx, wacc_value in enumerate(wacc_range):
571 for col_idx, term_growth_value in enumerate(term_growth_range):
572 # Build formula that uses wacc_value and term_growth_value
573 formula = f"=<DCF recalc using {wacc_value} and {term_growth_value}>"
574 ws.cell(row=start_row+row_idx, column=start_col+col_idx).value = formula
575```
577**The sensitivity tables must work immediately when the model is opened, with no manual steps required from the user.**
579</correct_patterns>
581<common_mistakes>
583This section contains all the WRONG patterns to avoid when building DCF models.

Correct Sensitivity Table Implementation

IMPORTANT: These are NOT Excel's "Data Table" feature. These are simple grids where you write regular formulas using openpyxl. Yes, this means ~75 formulas total (3 tables × 25 cells each), but this is straightforward and required.

Programmatic Population with Formulas:

Each sensitivity table must be fully populated with formulas that recalculate the implied share price for each combination of assumptions. Do not use Excel's Data Table feature (it requires manual intervention and cannot be automated via openpyxl).

Implementation approach - CONCRETE EXAMPLE:

Table Structure — 5×5 grid (ODD dimensions, base case centered):

If the model's base WACC = 9.0% and base terminal growth = 3.0%, build the axes symmetrically around those values:

WACC vs Terminal Growth,  2.0%,  2.5%,  3.0%,  3.5%,  4.0%
              8.0%,       [fml], [fml], [fml], [fml], [fml]
              8.5%,       [fml], [fml], [fml], [fml], [fml]
              9.0%,       [fml], [fml], [★  ], [fml], [fml]   ← middle row = base WACC
              9.5%,       [fml], [fml], [fml], [fml], [fml]
             10.0%,       [fml], [fml], [fml], [fml], [fml]
                                   ↑
                          middle col = base terminal g

★ = the center cell. Its formula output MUST equal the model's actual implied share price (from the valuation summary). Apply the medium-blue fill (#BDD7EE) and bold font to this cell so the base case is visually anchored.

Rule for axis values: axis_values = [base - 2*step, base - step, base, base + step, base + 2*step] — symmetric around the base, odd count guarantees a center.

Formula Pattern - Cell B88 (WACC=8.0%, Terminal Growth=2.0%):

The formula in B88 should recalculate the implied price using:

  • WACC from row header: $A88 (8.0%)
  • Terminal Growth from column header: B$87 (2.0%)

Recommended approach: Reference the main DCF calculation but substitute these values.

Example formula structure: =([SUM of PV FCFs using $A88 as discount rate] + [Terminal Value using B$87 as growth rate and $A88 as WACC] - [Net Debt]) / [Shares]

CRITICAL - Write a formula for EVERY cell in the 5x5 grid (25 cells per table, 75 cells total). Use openpyxl to write these formulas programmatically in a loop. Do NOT skip this step or leave placeholder text.

Python implementation pattern:

# Pseudocode for populating sensitivity table
for row_idx, wacc_value in enumerate(wacc_range):
    for col_idx, term_growth_value in enumerate(term_growth_range):
        # Build formula that uses wacc_value and term_growth_value
        formula = f"=<DCF recalc using {wacc_value} and {term_growth_value}>"
        ws.cell(row=start_row+row_idx, column=start_col+col_idx).value = formula

The sensitivity tables must work immediately when the model is opened, with no manual steps required from the user.

</correct_patterns>

<common_mistakes>

This section contains all the WRONG patterns to avoid when building DCF models.

Raw lines 525 to 584
585### WRONG: Simplified Sensitivity Table Approximations or Placeholder Text
587**Don't use linear approximations:**
589```
590// WRONG - Linear approximation
591B97: =B88*(1+(0.096-0.116)) // Assumes linear relationship
593// WRONG - Division shortcut
594B105: =B88/(1+(E48-0.07)) // Doesn't recalculate full DCF
595```
597**Don't leave placeholder text:**
598```
599// WRONG - Placeholder note
600"Note: Use Excel Data Table feature (Data → What-If Analysis → Data Table) to populate sensitivity tables."
602// WRONG - Empty cells
603[leaving cells blank because "this is complex"]
604```
606**Don't confuse terminology:**
607- ❌ "Sensitivity tables need Excel's Data Table feature" (NO - that's a specific Excel tool we can't use)
608- ✅ "Sensitivity tables are simple grids with formulas in each cell" (YES - this is what we build)
610**Why these shortcuts are wrong:**
611- Linear approximation formulas don't actually recalculate the DCF - they just apply simple math adjustments
612- The relationships are not linear, so the results will be inaccurate
613- Placeholder text requires manual user intervention
614- Model is not immediately usable when delivered
615- Not professional or client-ready
616- Empty cells = incomplete deliverable
618**Common rationalization to REJECT:**
619"Writing 75+ formulas feels complex, so I'll leave a note for the user to complete it manually."
621**Reality:** Writing 75 formulas is straightforward when you use a loop in Python with openpyxl. Each formula follows the same pattern - just substitute the row/column values. This is a required part of the deliverable.
623**Instead:** Populate every sensitivity cell with formulas that recalculate the full DCF for that specific combination of assumptions

WRONG: Simplified Sensitivity Table Approximations or Placeholder Text

Don't use linear approximations:

// WRONG - Linear approximation
B97: =B88*(1+(0.096-0.116))    // Assumes linear relationship

// WRONG - Division shortcut
B105: =B88/(1+(E48-0.07))      // Doesn't recalculate full DCF

Don't leave placeholder text:

// WRONG - Placeholder note
"Note: Use Excel Data Table feature (Data → What-If Analysis → Data Table) to populate sensitivity tables."

// WRONG - Empty cells
[leaving cells blank because "this is complex"]

Don't confuse terminology:

  • ❌ "Sensitivity tables need Excel's Data Table feature" (NO - that's a specific Excel tool we can't use)
  • ✅ "Sensitivity tables are simple grids with formulas in each cell" (YES - this is what we build)

Why these shortcuts are wrong:

  • Linear approximation formulas don't actually recalculate the DCF - they just apply simple math adjustments
  • The relationships are not linear, so the results will be inaccurate
  • Placeholder text requires manual user intervention
  • Model is not immediately usable when delivered
  • Not professional or client-ready
  • Empty cells = incomplete deliverable

Common rationalization to REJECT: "Writing 75+ formulas feels complex, so I'll leave a note for the user to complete it manually."

Reality: Writing 75 formulas is straightforward when you use a loop in Python with openpyxl. Each formula follows the same pattern - just substitute the row/column values. This is a required part of the deliverable.

Instead: Populate every sensitivity cell with formulas that recalculate the full DCF for that specific combination of assumptions

Raw lines 585 to 624
625### WRONG: Missing Cell Comments
627**Don't do this:**
628- Create all hardcoded inputs without comments
629- Think "I'll add them later"
630- Write "TODO: add source"
631- Leave blue inputs without documentation
633**Why it's wrong:**
634- Can't verify where data came from
635- Fails xlsx skill requirements
636- Not audit-ready
637- Wastes time fixing later
639**Instead:** Add cell comment AS EACH hardcoded value is created

WRONG: Missing Cell Comments

Don't do this:

  • Create all hardcoded inputs without comments
  • Think "I'll add them later"
  • Write "TODO: add source"
  • Leave blue inputs without documentation

Why it's wrong:

  • Can't verify where data came from
  • Fails xlsx skill requirements
  • Not audit-ready
  • Wastes time fixing later

Instead: Add cell comment AS EACH hardcoded value is created

Raw lines 625 to 640
641### WRONG: Formula Row References Off
643**Symptom:**
644The FCF section references wrong assumption rows:
645`D&A: =E29*$E$34 // Should be $E$21, but referencing wrong row`
646`CapEx: =E29*$E$41 // Should be $E$22, but row shifted`
648**Why this happens:**
6491. Formulas written first
6502. Then headers inserted
6513. All row references shifted
6524. Now formulas point to wrong cells → #REF! errors
654**Instead:** Lock row layout FIRST, then write formulas

WRONG: Formula Row References Off

Symptom: The FCF section references wrong assumption rows: D&A: =E29*$E$34 // Should be $E$21, but referencing wrong row CapEx: =E29*$E$41 // Should be $E$22, but row shifted

Why this happens:

  1. Formulas written first
  2. Then headers inserted
  3. All row references shifted
  4. Now formulas point to wrong cells → #REF! errors

Instead: Lock row layout FIRST, then write formulas

Raw lines 641 to 655
656### WRONG: Single Row for Each Assumption Across Scenarios
658**Don't structure assumptions like this:**
659```csv
660Assumption,Bear,Base,Bull
661Revenue Growth FY1,10%,13%,16%
662Revenue Growth FY2,9%,12%,15%
663```
664This vertical layout makes it hard to see the progression across years within each scenario.
666**Why it's wrong:**
667- Makes it difficult to see assumptions evolving across years within each scenario
668- Harder to compare scenario assumptions across full projection period
669- Less intuitive for reviewing scenario logic
671**Instead:**
672- Create separate blocks for each scenario (Bear, Base, Bull)
673- Within each block, show assumptions horizontally across projection years
674- This makes each scenario's assumptions easier to review as a cohesive set

WRONG: Single Row for Each Assumption Across Scenarios

Don't structure assumptions like this:

Assumption,Bear,Base,Bull
Revenue Growth FY1,10%,13%,16%
Revenue Growth FY2,9%,12%,15%

This vertical layout makes it hard to see the progression across years within each scenario.

Why it's wrong:

  • Makes it difficult to see assumptions evolving across years within each scenario
  • Harder to compare scenario assumptions across full projection period
  • Less intuitive for reviewing scenario logic

Instead:

  • Create separate blocks for each scenario (Bear, Base, Bull)
  • Within each block, show assumptions horizontally across projection years
  • This makes each scenario's assumptions easier to review as a cohesive set
Raw lines 656 to 675
676### WRONG: No Borders
678**Don't deliver a model without borders:**
679- No section delineation
680- All cells blend together
681- Hard to read and unprofessional
683**Why it's wrong:**
684- Not client-ready
685- Difficult to navigate
686- Looks amateur
688**Instead:** Add borders around all major sections

WRONG: No Borders

Don't deliver a model without borders:

  • No section delineation
  • All cells blend together
  • Hard to read and unprofessional

Why it's wrong:

  • Not client-ready
  • Difficult to navigate
  • Looks amateur

Instead: Add borders around all major sections

Raw lines 676 to 689
690### WRONG: Wrong Font Colors or No Font Color Distinction
692**Don't do this:**
693- All text is black
694- Only use fill colors (no font color changes)
695- Mix up which cells are blue vs black
697**Why it's wrong:**
698- Can't distinguish inputs from formulas
699- Auditing becomes impossible
700- Violates xlsx skill requirements
702**Instead:** Blue text for ALL hardcoded inputs, black text for ALL formulas, green for sheet links

WRONG: Wrong Font Colors or No Font Color Distinction

Don't do this:

  • All text is black
  • Only use fill colors (no font color changes)
  • Mix up which cells are blue vs black

Why it's wrong:

  • Can't distinguish inputs from formulas
  • Auditing becomes impossible
  • Violates xlsx skill requirements

Instead: Blue text for ALL hardcoded inputs, black text for ALL formulas, green for sheet links

Raw lines 690 to 703
704### WRONG: Operating Expenses Based on Gross Profit
706**Don't do this:**
707`S&M: =E33*0.15 // E33 = Gross Profit (WRONG)`
709**Why it's wrong:**
710- Operating expenses scale with revenue, not gross profit
711- Produces unrealistic margin progression
712- Not how businesses actually operate
714**Instead:**
715`S&M: =E29*0.15 // E29 = Revenue (CORRECT)`

WRONG: Operating Expenses Based on Gross Profit

Don't do this: S&M: =E33*0.15 // E33 = Gross Profit (WRONG)

Why it's wrong:

  • Operating expenses scale with revenue, not gross profit
  • Produces unrealistic margin progression
  • Not how businesses actually operate

Instead: S&M: =E29*0.15 // E29 = Revenue (CORRECT)

Raw lines 704 to 716
717### TOP 5 ERRORS SUMMARY
7191. **Formula row references off** → Define ALL row positions BEFORE writing formulas
7202. **Missing cell comments** → Add comments AS cells are created, not at end
7213. **Simplified sensitivity tables** → Populate all cells with full DCF recalc formulas, not approximations
7224. **Scenario block references wrong** → Ensure IF formulas pull from correct Bear/Base/Bull blocks
7235. **No borders** → Add professional section borders for client-ready appearance
725In addition, be aware of these errors:

TOP 5 ERRORS SUMMARY

  1. Formula row references off → Define ALL row positions BEFORE writing formulas
  2. Missing cell comments → Add comments AS cells are created, not at end
  3. Simplified sensitivity tables → Populate all cells with full DCF recalc formulas, not approximations
  4. Scenario block references wrong → Ensure IF formulas pull from correct Bear/Base/Bull blocks
  5. No borders → Add professional section borders for client-ready appearance

In addition, be aware of these errors:

Raw lines 717 to 726
727### WACC Calculation Errors
728- Mixing book and market values in capital structure
729- Using equity beta instead of asset/unlevered beta incorrectly
730- Wrong tax rate application to cost of debt
731- Incorrect risk-free rate (must use current 10Y Treasury)
732- Failure to adjust for net debt vs net cash position

WACC Calculation Errors

  • Mixing book and market values in capital structure
  • Using equity beta instead of asset/unlevered beta incorrectly
  • Wrong tax rate application to cost of debt
  • Incorrect risk-free rate (must use current 10Y Treasury)
  • Failure to adjust for net debt vs net cash position
Raw lines 727 to 733
734### Growth Assumption Flaws
735- Terminal growth > WACC (creates infinite value)
736- Projection growth rates inconsistent with historical performance
737- Ignoring industry growth constraints
738- Revenue growth not aligned with unit economics
739- Margin expansion without operational justification

Growth Assumption Flaws

  • Terminal growth > WACC (creates infinite value)
  • Projection growth rates inconsistent with historical performance
  • Ignoring industry growth constraints
  • Revenue growth not aligned with unit economics
  • Margin expansion without operational justification
Raw lines 734 to 740
741### Terminal Value Mistakes
742- Using wrong growth method (perpetuity vs exit multiple)
743- Terminal value >80% of enterprise value (suggests over-reliance)
744- Inconsistent terminal margins with steady state assumptions
745- Wrong discount period for terminal value

Terminal Value Mistakes

  • Using wrong growth method (perpetuity vs exit multiple)
  • Terminal value >80% of enterprise value (suggests over-reliance)
  • Inconsistent terminal margins with steady state assumptions
  • Wrong discount period for terminal value
Raw lines 741 to 746
747### Cash Flow Projection Errors
748- Operating expenses based on gross profit instead of revenue
749- D&A/CapEx percentages misaligned with business model
750- Working capital changes not properly calculated
751- Tax rate inconsistency between years
752- NOPAT calculation errors
754**These errors are the most common. Re-read this section before starting any DCF build.**
756</common_mistakes>

Cash Flow Projection Errors

  • Operating expenses based on gross profit instead of revenue
  • D&A/CapEx percentages misaligned with business model
  • Working capital changes not properly calculated
  • Tax rate inconsistency between years
  • NOPAT calculation errors

These errors are the most common. Re-read this section before starting any DCF build.

</common_mistakes>

Raw lines 747 to 757
758## Excel File Creation
761- Standardized formula construction rules
762- Number formatting conventions
763- Automated formula recalculation via `recalc.py` script
764- Comprehensive error checking and validation
766All Excel files created by this skill must follow xlsx skill requirements, including zero formula errors and proper recalculation.

Excel File Creation

**This skill uses the xlsx skill for all spreadsheet operations.** The xlsx skill provides:

  • Standardized formula construction rules
  • Number formatting conventions
  • Automated formula recalculation via recalc.py script
  • Comprehensive error checking and validation

All Excel files created by this skill must follow xlsx skill requirements, including zero formula errors and proper recalculation.

Raw lines 758 to 767
Names a skill xlsx-author :760
768## Quality Rubric
770Every DCF model must maximize for:
7711. **Realistic revenue and margin assumptions** based on historical performance
7722. **Appropriate cost of capital calculation** with proper CAPM methodology
7733. **Comprehensive sensitivity analysis** showing valuation ranges
7744. **Clear terminal value calculation** with supporting rationale
7755. **Professional model structure** enabling scenario analysis
7766. **Transparent documentation** of all key assumptions

Quality Rubric

Every DCF model must maximize for:

  1. Realistic revenue and margin assumptions based on historical performance
  2. Appropriate cost of capital calculation with proper CAPM methodology
  3. Comprehensive sensitivity analysis showing valuation ranges
  4. Clear terminal value calculation with supporting rationale
  5. Professional model structure enabling scenario analysis
  6. Transparent documentation of all key assumptions
Raw lines 768 to 777
778## Input Requirements

Input Requirements

Raw lines 778 to 779
780### Minimum Required Inputs
7811. **Company identifier**: Ticker symbol or company name
7822. **Growth assumptions**: Revenue growth rates for projection period (or "use consensus")
7833. **Optional parameters**:
784 - Projection period (default: 5 years)
785 - Scenario cases (Bear/Base/Bull growth and margin assumptions)
786 - Terminal growth rate (default: 2.5-3.0%)
787 - Specific WACC inputs if not using CAPM

Minimum Required Inputs

  1. Company identifier: Ticker symbol or company name
  2. Growth assumptions: Revenue growth rates for projection period (or "use consensus")
  3. Optional parameters:
  4. Projection period (default: 5 years)
  5. Scenario cases (Bear/Base/Bull growth and margin assumptions)
  6. Terminal growth rate (default: 2.5-3.0%)
  7. Specific WACC inputs if not using CAPM
Raw lines 780 to 788
789## Excel Model Structure

Excel Model Structure

Raw lines 789 to 790
791### Sheet Architecture
793Create **two sheets**:
7951. **DCF** - Main valuation model with sensitivity analysis at bottom
7962. **WACC** - Cost of capital calculation
798**CRITICAL**: Sensitivity tables go at the BOTTOM of the DCF sheet (not on a separate sheet). This keeps all valuation outputs together.

Sheet Architecture

Create two sheets:

  1. DCF - Main valuation model with sensitivity analysis at bottom
  2. WACC - Cost of capital calculation

CRITICAL: Sensitivity tables go at the BOTTOM of the DCF sheet (not on a separate sheet). This keeps all valuation outputs together.

Raw lines 791 to 799
800### Formula Recalculation (MANDATORY)
802After creating or modifying the Excel model, **recalculate all formulas** using the recalc.py script from the xlsx skill:
804```bash
805python recalc.py [path_to_excel_file] [timeout_seconds]
806```
808Example:
809```bash
810python recalc.py AAPL_DCF_Model_2025-10-12.xlsx 30
811```
813The script will:
814- Recalculate all formulas in all sheets using LibreOffice
815- Scan ALL cells for Excel errors (#REF!, #DIV/0!, #VALUE!, #NAME?, #NULL!, #NUM!, #N/A)
816- Return detailed JSON with error locations and counts
818**Expected output format:**
819```json
821 "status": "success", // or "errors_found"
822 "total_errors": 0, // Total error count
823 "total_formulas": 42, // Number of formulas in file
824 "error_summary": {} // Only present if errors found
826```
828**If errors are found**, the output will include details:
829```json
831 "status": "errors_found",
832 "total_errors": 2,
833 "total_formulas": 42,
834 "error_summary": {
835 "#REF!": {
836 "count": 2,
837 "locations": ["DCF!B25", "DCF!C25"]
838 }
839 }
841```
843**Fix all errors** and re-run recalc.py until status is "success" before delivering the model.

Formula Recalculation (MANDATORY)

After creating or modifying the Excel model, recalculate all formulas using the recalc.py script from the xlsx skill:

python recalc.py [path_to_excel_file] [timeout_seconds]

Example:

python recalc.py AAPL_DCF_Model_2025-10-12.xlsx 30

The script will:

  • Recalculate all formulas in all sheets using LibreOffice
  • Scan ALL cells for Excel errors (#REF!, #DIV/0!, #VALUE!, #NAME?, #NULL!, #NUM!, #N/A)
  • Return detailed JSON with error locations and counts

Expected output format:

{
  "status": "success",           // or "errors_found"
  "total_errors": 0,              // Total error count
  "total_formulas": 42,           // Number of formulas in file
  "error_summary": {}             // Only present if errors found
}

If errors are found, the output will include details:

{
  "status": "errors_found",
  "total_errors": 2,
  "total_formulas": 42,
  "error_summary": {
    "#REF!": {
      "count": 2,
      "locations": ["DCF!B25", "DCF!C25"]
    }
  }
}

Fix all errors and re-run recalc.py until status is "success" before delivering the model.

Raw lines 800 to 844
Runs code python recalc.py :805
845### Formatting Standards
847**IMPORTANT**: Follow the xlsx skill for formula construction rules and number formatting conventions. The DCF skill adds specific visual presentation standards.
849**Color Scheme - Two Layers**:
851**Layer 1: Font Colors (MANDATORY from xlsx skill)**
852- **Blue text (RGB: 0,0,255)**: ALL hardcoded inputs (stock price, shares, historical data, assumptions)
853- **Black text (RGB: 0,0,0)**: ALL formulas and calculations
854- **Green text (RGB: 0,128,0)**: Links to other sheets (WACC sheet references)
856**Layer 2: Fill Colors — Professional Blue/Grey Palette (Default unless user specifies otherwise)**
857- **Keep it minimal** — use only blues and greys for fills. Do NOT introduce greens, yellows, oranges, or multiple accent colors. A model with too many colors looks amateurish.
858- **Default fill palette:**
859 - **Section headers**: Dark blue (RGB: 31,78,121 / `#1F4E79`) background with white bold text
860 - **Sub-headers/column headers**: Light blue (RGB: 217,225,242 / `#D9E1F2`) background with black bold text
861 - **Input cells**: Light grey (RGB: 242,242,242 / `#F2F2F2`) background with blue font — or just white with blue font if you want maximum minimalism
862 - **Calculated cells**: White background with black font
863 - **Output/summary rows** (per-share value, EV, etc.): Medium blue (RGB: 189,215,238 / `#BDD7EE`) background with black bold font
864- **That's it — 3 blues + 1 grey + white.** Resist the urge to add more.
865- User-provided templates or explicit color preferences ALWAYS override these defaults.
867**How the layers work together:**
868- Input cell: Blue font + light grey fill = "Hardcoded input"
869- Formula cell: Black font + white background = "Calculated value"
870- Sheet link: Green font + white background = "Reference from another sheet"
871- Key output: Black bold font + medium blue fill = "This is the answer"
873**Font color tells you WHAT it is (input/formula/link). Fill color tells you WHERE you are (header/data/output).**

Formatting Standards

IMPORTANT: Follow the xlsx skill for formula construction rules and number formatting conventions. The DCF skill adds specific visual presentation standards.

Color Scheme - Two Layers:

Layer 1: Font Colors (MANDATORY from xlsx skill)

  • Blue text (RGB: 0,0,255): ALL hardcoded inputs (stock price, shares, historical data, assumptions)
  • Black text (RGB: 0,0,0): ALL formulas and calculations
  • Green text (RGB: 0,128,0): Links to other sheets (WACC sheet references)

Layer 2: Fill Colors — Professional Blue/Grey Palette (Default unless user specifies otherwise)

  • Keep it minimal — use only blues and greys for fills. Do NOT introduce greens, yellows, oranges, or multiple accent colors. A model with too many colors looks amateurish.
  • Default fill palette:
  • Section headers: Dark blue (RGB: 31,78,121 / #1F4E79) background with white bold text
  • Sub-headers/column headers: Light blue (RGB: 217,225,242 / #D9E1F2) background with black bold text
  • Input cells: Light grey (RGB: 242,242,242 / #F2F2F2) background with blue font — or just white with blue font if you want maximum minimalism
  • Calculated cells: White background with black font
  • Output/summary rows (per-share value, EV, etc.): Medium blue (RGB: 189,215,238 / #BDD7EE) background with black bold font
  • That's it — 3 blues + 1 grey + white. Resist the urge to add more.
  • User-provided templates or explicit color preferences ALWAYS override these defaults.

How the layers work together:

  • Input cell: Blue font + light grey fill = "Hardcoded input"
  • Formula cell: Black font + white background = "Calculated value"
  • Sheet link: Green font + white background = "Reference from another sheet"
  • Key output: Black bold font + medium blue fill = "This is the answer"

Font color tells you WHAT it is (input/formula/link). Fill color tells you WHERE you are (header/data/output).

Raw lines 845 to 874
875### Border Standards (REQUIRED for Professional Appearance)
877**Thick borders** (1.5pt) around major sections:
878- KEY INPUTS section
879- PROJECTION ASSUMPTIONS section
880- 5-YEAR CASH FLOW PROJECTION section
881- TERMINAL VALUE section
882- VALUATION SUMMARY section
883- Each SENSITIVITY ANALYSIS table
885**Medium borders** (1pt) between sub-sections:
886- Company Details vs Historical Performance
887- Growth Assumptions vs EBIT Margin vs FCF Parameters
889**Thin borders** (0.5pt) around data tables:
890- Scenario assumption tables (Bear | Base | Bull | Selected)
891- Historical vs projected financials matrix
893**No borders:** Individual cells within tables (keep clean, scannable)
895**Borders are mandatory** - models without professional borders are not client-ready.
897**Number Formats** (follows xlsx skill standards):
898- **Years**: Format as text strings (e.g., "2024" not "2,024")
899- **Percentages**: `0.0%` (one decimal place)
900- **Currency**: `$#,##0` for millions; `$#,##0.00` for per-share - ALWAYS specify units in headers ("Revenue ($mm)")
901- **Zeros**: Use number formatting to make all zeros "-" (e.g., `$#,##0;($#,##0);-`)
902- **Large numbers**: `#,##0` with thousands separator
903- **Negative numbers**: `(#,##0)` in parentheses (NOT minus sign)
905**Cell Comments (MANDATORY for all hardcoded inputs)**:
907Per the xlsx skill, ALL hardcoded values must have cell comments documenting the source. Format: "Source: [System/Document], [Date], [Reference], [URL if applicable]"
909**CRITICAL**: Add comments AS CELLS ARE CREATED. Do not defer to the end.

Border Standards (REQUIRED for Professional Appearance)

Thick borders (1.5pt) around major sections:

  • KEY INPUTS section
  • PROJECTION ASSUMPTIONS section
  • 5-YEAR CASH FLOW PROJECTION section
  • TERMINAL VALUE section
  • VALUATION SUMMARY section
  • Each SENSITIVITY ANALYSIS table

Medium borders (1pt) between sub-sections:

  • Company Details vs Historical Performance
  • Growth Assumptions vs EBIT Margin vs FCF Parameters

Thin borders (0.5pt) around data tables:

  • Scenario assumption tables (Bear | Base | Bull | Selected)
  • Historical vs projected financials matrix

No borders: Individual cells within tables (keep clean, scannable)

Borders are mandatory - models without professional borders are not client-ready.

Number Formats (follows xlsx skill standards):

  • Years: Format as text strings (e.g., "2024" not "2,024")
  • Percentages: 0.0% (one decimal place)
  • Currency: $#,##0 for millions; $#,##0.00 for per-share - ALWAYS specify units in headers ("Revenue ($mm)")
  • Zeros: Use number formatting to make all zeros "-" (e.g., $#,##0;($#,##0);-)
  • Large numbers: #,##0 with thousands separator
  • Negative numbers: (#,##0) in parentheses (NOT minus sign)

Cell Comments (MANDATORY for all hardcoded inputs):

Per the xlsx skill, ALL hardcoded values must have cell comments documenting the source. Format: "Source: [System/Document], [Date], [Reference], [URL if applicable]"

CRITICAL: Add comments AS CELLS ARE CREATED. Do not defer to the end.

Raw lines 875 to 910
911### DCF Sheet Detailed Structure
913**Section 1: Header**
914```csv
915Row,Content
9161,[Company Name] DCF Model
9172,Ticker: [XXX] | Date: [Date] | Year End: [FYE]
9183,Blank
9194,Case Selector Cell (1=Bear 2=Base 3=Bull)
9205,Case Name Display (formula: =IF([Selector]=1"Bear"IF([Selector]=2"Base""Bull")))
921```
923**Section 2: Market Data (NOT case dependent)**
924```csv
925Item,Value
926Current Stock Price,$XX.XX
927Shares Outstanding (M),XX.X
928Market Cap ($M),[Formula]
929Net Debt ($M),XXX [or Net Cash if negative]
930```
932**Section 3: DCF Scenario Assumptions**
934Create separate assumption blocks for each scenario (Bear, Base, Bull) with DCF-specific assumptions (Revenue Growth %, EBIT Margin %, Tax Rate %, D&A % of Revenue, CapEx % of Revenue, NWC Change % of ΔRev, Terminal Growth Rate, WACC) laid out horizontally across projection years. Each block must include section header, column header row showing the projection years (FY1, FY2, etc.), and data rows. See `<correct_patterns>` section "Correct Assumption Table Structure" for the exact layout.
936**Section 4: Historical & Projected Financials**
938**Reference a consolidation column (e.g., "Selected Case") that pulls from scenario blocks**, not scattered IF formulas in every projection row.
940```csv
941Income Statement ($M),2020A,2021A,2022A,2023A,2024E,2025E,2026E
942Revenue,XXX,XXX,XXX,XXX,[=E29*(1+$E$10)],[=F29*(1+$E$11)],[=G29*(1+$E$12)]
943 % growth,XX%,XX%,XX%,XX%,[=E29/D29-1],[=F29/E29-1],[=G29/F29-1]
944,,,,,,
945Gross Profit,XXX,XXX,XXX,XXX,[=E29*E33],[=F29*F33],[=G29*G33]
946 % margin,XX%,XX%,XX%,XX%,[=E33/E29],[=F33/F29],[=G33/G29]
947,,,,,,
948Operating Expenses:,,,,,,,
949 S&M,XXX,XXX,XXX,XXX,[=E29*0.15],[=F29*0.14],[=G29*0.13]
950 R&D,XXX,XXX,XXX,XXX,[=E29*0.12],[=F29*0.11],[=G29*0.10]
951 G&A,XXX,XXX,XXX,XXX,[=E29*0.08],[=F29*0.07],[=G29*0.07]
952 Total OpEx,XXX,XXX,XXX,XXX,[=E36+E37+E38],[=F36+F37+F38],[=G36+G37+G38]
953,,,,,,
954EBIT,XXX,XXX,XXX,XXX,[=E33-E39],[=F33-F39],[=G33-G39]
955 % margin,XX%,XX%,XX%,XX%,[=E41/E29],[=F41/F29],[=G41/G29]
956,,,,,,
957Taxes,(XX),(XX),(XX),(XX),[=E41*$E$24],[=F41*$E$24],[=G41*$E$24]
958 Tax rate,XX%,XX%,XX%,XX%,[=E43/E41],[=F43/F41],[=G43/G41]
959,,,,,,
960NOPAT,XXX,XXX,XXX,XXX,[=E41-E43],[=F41-F43],[=G41-G43]
961```
963**Key Formula Pattern**:
964- Revenue growth: `=E29*(1+$E$10)` where $E$10 is consolidation column for Year 1 growth
965- NOT: `=E29*(1+IF($B$6=1,$B$10,IF($B$6=2,$C$10,$D$10)))`
967This approach is cleaner, easier to audit, and prevents formula errors by centralizing the scenario logic.
969**Section 5: Free Cash Flow Build**
971**CRITICAL**: Verify row references point to the CORRECT assumption rows. Test formulas immediately after creation.
973```csv
974Cash Flow ($M),2020A,2021A,2022A,2023A,2024E,2025E,2026E
975NOPAT,XXX,XXX,XXX,XXX,[=E45],[=F45],[=G45]
976(+) D&A,XXX,XXX,XXX,XXX,[=E29*$E$21],[=F29*$E$21],[=G29*$E$21]
977 % of Rev,XX%,XX%,XX%,XX%,[=E58/E29],[=F58/F29],[=G58/G29]
978(-) CapEx,(XX),(XX),(XX),(XX),[=E29*$E$22],[=F29*$E$22],[=G29*$E$22]
979 % of Rev,XX%,XX%,XX%,XX%,[=E60/E29],[=F60/F29],[=G60/G29]
980(-) Δ NWC,(XX),(XX),(XX),(XX),[=(E29-D29)*$E$23],[=(F29-E29)*$E$23],[=(G29-F29)*$E$23]
981 % of Δ Rev,XX%,XX%,XX%,XX%,[=E62/(E29-D29)],[=F62/(F29-E29)],[=G62/(G29-F29)]
982,,,,,,
983Unlevered FCF,XXX,XXX,XXX,XXX,[=E57+E58-E60-E62],[=F57+F58-F60-F62],[=G57+G58-G60-G62]
984```
986**Row reference examples** (based on layout planning):
987- $E$21 = D&A % assumption (consolidation column, row 21)
988- $E$22 = CapEx % assumption (consolidation column, row 22)
989- $E$23 = NWC % assumption (consolidation column, row 23)
990- E29 = Revenue for year (row 29)
991- E45 = NOPAT for year (row 45)
993**Before writing formulas**: Confirm these row numbers match the actual layout. Test one column, then copy across.
995**Section 6: Discounting & Valuation**
996```csv
997DCF Valuation,2024E,2025E,2026E,2027E,2028E,Terminal
998Unlevered FCF ($M),XXX,XXX,XXX,XXX,XXX,
999Period,0.5,1.5,2.5,3.5,4.5,
1000Discount Factor,0.XX,0.XX,0.XX,0.XX,0.XX,
1001PV of FCF ($M),XXX,XXX,XXX,XXX,XXX,
1002,,,,,,
1003Terminal FCF ($M),,,,,,,XXX
1004Terminal Value ($M),,,,,,,XXX
1005PV Terminal Value ($M),,,,,,,XXX
1006,,,,,,
1007Valuation Summary ($M),,,,,,
1008Sum of PV FCFs,XXX,,,,,
1009PV Terminal Value,XXX,,,,,
1010Enterprise Value,XXX,,,,,
1011(-) Net Debt,(XX),,,,,
1012Equity Value,XXX,,,,,
1013,,,,,,
1014Shares Outstanding (M),XX.X,,,,,
1015IMPLIED PRICE PER SHARE,$XX.XX,,,,,
1016Current Stock Price,$XX.XX,,,,,
1017Implied Upside/(Downside),XX%,,,,,
1018```

DCF Sheet Detailed Structure

Section 1: Header

Row,Content
1,[Company Name] DCF Model
2,Ticker: [XXX] | Date: [Date] | Year End: [FYE]
3,Blank
4,Case Selector Cell (1=Bear 2=Base 3=Bull)
5,Case Name Display (formula: =IF([Selector]=1"Bear"IF([Selector]=2"Base""Bull")))

Section 2: Market Data (NOT case dependent)

Item,Value
Current Stock Price,$XX.XX
Shares Outstanding (M),XX.X
Market Cap ($M),[Formula]
Net Debt ($M),XXX [or Net Cash if negative]

Section 3: DCF Scenario Assumptions

Create separate assumption blocks for each scenario (Bear, Base, Bull) with DCF-specific assumptions (Revenue Growth %, EBIT Margin %, Tax Rate %, D&A % of Revenue, CapEx % of Revenue, NWC Change % of ΔRev, Terminal Growth Rate, WACC) laid out horizontally across projection years. Each block must include section header, column header row showing the projection years (FY1, FY2, etc.), and data rows. See <correct_patterns> section "Correct Assumption Table Structure" for the exact layout.

Section 4: Historical & Projected Financials

Reference a consolidation column (e.g., "Selected Case") that pulls from scenario blocks, not scattered IF formulas in every projection row.

Income Statement ($M),2020A,2021A,2022A,2023A,2024E,2025E,2026E
Revenue,XXX,XXX,XXX,XXX,[=E29*(1+$E$10)],[=F29*(1+$E$11)],[=G29*(1+$E$12)]
  % growth,XX%,XX%,XX%,XX%,[=E29/D29-1],[=F29/E29-1],[=G29/F29-1]
,,,,,,
Gross Profit,XXX,XXX,XXX,XXX,[=E29*E33],[=F29*F33],[=G29*G33]
  % margin,XX%,XX%,XX%,XX%,[=E33/E29],[=F33/F29],[=G33/G29]
,,,,,,
Operating Expenses:,,,,,,,
  S&M,XXX,XXX,XXX,XXX,[=E29*0.15],[=F29*0.14],[=G29*0.13]
  R&D,XXX,XXX,XXX,XXX,[=E29*0.12],[=F29*0.11],[=G29*0.10]
  G&A,XXX,XXX,XXX,XXX,[=E29*0.08],[=F29*0.07],[=G29*0.07]
  Total OpEx,XXX,XXX,XXX,XXX,[=E36+E37+E38],[=F36+F37+F38],[=G36+G37+G38]
,,,,,,
EBIT,XXX,XXX,XXX,XXX,[=E33-E39],[=F33-F39],[=G33-G39]
  % margin,XX%,XX%,XX%,XX%,[=E41/E29],[=F41/F29],[=G41/G29]
,,,,,,
Taxes,(XX),(XX),(XX),(XX),[=E41*$E$24],[=F41*$E$24],[=G41*$E$24]
  Tax rate,XX%,XX%,XX%,XX%,[=E43/E41],[=F43/F41],[=G43/G41]
,,,,,,
NOPAT,XXX,XXX,XXX,XXX,[=E41-E43],[=F41-F43],[=G41-G43]

Key Formula Pattern:

  • Revenue growth: =E29*(1+$E$10) where $E$10 is consolidation column for Year 1 growth
  • NOT: =E29*(1+IF($B$6=1,$B$10,IF($B$6=2,$C$10,$D$10)))

This approach is cleaner, easier to audit, and prevents formula errors by centralizing the scenario logic.

Section 5: Free Cash Flow Build

CRITICAL: Verify row references point to the CORRECT assumption rows. Test formulas immediately after creation.

Cash Flow ($M),2020A,2021A,2022A,2023A,2024E,2025E,2026E
NOPAT,XXX,XXX,XXX,XXX,[=E45],[=F45],[=G45]
(+) D&A,XXX,XXX,XXX,XXX,[=E29*$E$21],[=F29*$E$21],[=G29*$E$21]
    % of Rev,XX%,XX%,XX%,XX%,[=E58/E29],[=F58/F29],[=G58/G29]
(-) CapEx,(XX),(XX),(XX),(XX),[=E29*$E$22],[=F29*$E$22],[=G29*$E$22]
    % of Rev,XX%,XX%,XX%,XX%,[=E60/E29],[=F60/F29],[=G60/G29]
(-) Δ NWC,(XX),(XX),(XX),(XX),[=(E29-D29)*$E$23],[=(F29-E29)*$E$23],[=(G29-F29)*$E$23]
    % of Δ Rev,XX%,XX%,XX%,XX%,[=E62/(E29-D29)],[=F62/(F29-E29)],[=G62/(G29-F29)]
,,,,,,
Unlevered FCF,XXX,XXX,XXX,XXX,[=E57+E58-E60-E62],[=F57+F58-F60-F62],[=G57+G58-G60-G62]

Row reference examples (based on layout planning):

  • $E$21 = D&A % assumption (consolidation column, row 21)
  • $E$22 = CapEx % assumption (consolidation column, row 22)
  • $E$23 = NWC % assumption (consolidation column, row 23)
  • E29 = Revenue for year (row 29)
  • E45 = NOPAT for year (row 45)

Before writing formulas: Confirm these row numbers match the actual layout. Test one column, then copy across.

Section 6: Discounting & Valuation

DCF Valuation,2024E,2025E,2026E,2027E,2028E,Terminal
Unlevered FCF ($M),XXX,XXX,XXX,XXX,XXX,
Period,0.5,1.5,2.5,3.5,4.5,
Discount Factor,0.XX,0.XX,0.XX,0.XX,0.XX,
PV of FCF ($M),XXX,XXX,XXX,XXX,XXX,
,,,,,,
Terminal FCF ($M),,,,,,,XXX
Terminal Value ($M),,,,,,,XXX
PV Terminal Value ($M),,,,,,,XXX
,,,,,,
Valuation Summary ($M),,,,,,
Sum of PV FCFs,XXX,,,,,
PV Terminal Value,XXX,,,,,
Enterprise Value,XXX,,,,,
(-) Net Debt,(XX),,,,,
Equity Value,XXX,,,,,
,,,,,,
Shares Outstanding (M),XX.X,,,,,
IMPLIED PRICE PER SHARE,$XX.XX,,,,,
Current Stock Price,$XX.XX,,,,,
Implied Upside/(Downside),XX%,,,,,
Raw lines 911 to 1019
1020### WACC Sheet Structure
1022```csv
1023COST OF EQUITY CALCULATION,,
1024Risk-Free Rate (10Y Treasury),X.XX%,[Yellow input]
1025Beta (5Y monthly),X.XX,[Yellow input]
1026Equity Risk Premium,X.XX%,[Yellow input]
1027Cost of Equity,X.XX%,[Calculated blue]
1029COST OF DEBT CALCULATION,,
1030Credit Rating,AA-,[Yellow input]
1031Pre-Tax Cost of Debt,X.XX%,[Yellow input]
1032Tax Rate,XX.X%,[Link to DCF sheet]
1033After-Tax Cost of Debt,X.XX%,[Calculated blue]
1035CAPITAL STRUCTURE,,
1036Current Stock Price,$XX.XX,[Link to DCF]
1037Shares Outstanding (M),XX.X,[Link to DCF]
1038Market Capitalization ($M),"X,XXX",[Calculated]
1040Total Debt ($M),XXX,[Yellow input]
1041Cash & Equivalents ($M),XXX,[Yellow input]
1042Net Debt ($M),XXX,[Calculated]
1044Enterprise Value ($M),"X,XXX",[Calculated]
1046WACC CALCULATION,Weight,Cost,Contribution
1047Equity,XX.X%,X.X%,X.XX%
1048Debt,XX.X%,X.X%,X.XX%
1050WEIGHTED AVERAGE COST OF CAPITAL,X.XX%,[Green output]
1051```
1053**Key WACC Formulas:**
1054```
1055Market Cap = Price × Shares
1056Net Debt = Total Debt - Cash
1057Enterprise Value = Market Cap + Net Debt
1058Equity Weight = Market Cap / EV
1059Debt Weight = Net Debt / EV
1060WACC = (Cost of Equity × Equity Weight) + (After-tax Cost of Debt × Debt Weight)
1061```

WACC Sheet Structure

COST OF EQUITY CALCULATION,,
Risk-Free Rate (10Y Treasury),X.XX%,[Yellow input]
Beta (5Y monthly),X.XX,[Yellow input]
Equity Risk Premium,X.XX%,[Yellow input]
Cost of Equity,X.XX%,[Calculated blue]
,,
COST OF DEBT CALCULATION,,
Credit Rating,AA-,[Yellow input]
Pre-Tax Cost of Debt,X.XX%,[Yellow input]
Tax Rate,XX.X%,[Link to DCF sheet]
After-Tax Cost of Debt,X.XX%,[Calculated blue]
,,
CAPITAL STRUCTURE,,
Current Stock Price,$XX.XX,[Link to DCF]
Shares Outstanding (M),XX.X,[Link to DCF]
Market Capitalization ($M),"X,XXX",[Calculated]
,,
Total Debt ($M),XXX,[Yellow input]
Cash & Equivalents ($M),XXX,[Yellow input]
Net Debt ($M),XXX,[Calculated]
,,
Enterprise Value ($M),"X,XXX",[Calculated]
,,
WACC CALCULATION,Weight,Cost,Contribution
Equity,XX.X%,X.X%,X.XX%
Debt,XX.X%,X.X%,X.XX%
,,
WEIGHTED AVERAGE COST OF CAPITAL,X.XX%,[Green output]

Key WACC Formulas:

Market Cap = Price × Shares
Net Debt = Total Debt - Cash
Enterprise Value = Market Cap + Net Debt
Equity Weight = Market Cap / EV
Debt Weight = Net Debt / EV
WACC = (Cost of Equity × Equity Weight) + (After-tax Cost of Debt × Debt Weight)
Raw lines 1020 to 1062
1063### Sensitivity Analysis (Bottom of DCF Sheet)
1065**TERMINOLOGY REMINDER**: "Sensitivity tables" = simple 2D grids with row headers, column headers, and formulas in each data cell. NOT Excel's "Data Table" feature (Data → What-If Analysis → Data Table). You will use openpyxl to write regular Excel formulas into each cell.
1067**Location**: Rows 87+ on DCF sheet (NOT a separate sheet)
1069**Three sensitivity tables, vertically stacked:**
10711. **WACC vs Terminal Growth** (rows 87-100) - 5x5 grid = 25 cells with formulas
10722. **Revenue Growth vs EBIT Margin** (rows 102-115) - 5x5 grid = 25 cells with formulas
10733. **Beta vs Risk-Free Rate** (rows 117-130) - 5x5 grid = 25 cells with formulas
1075**Total formulas to write: 75** (this is required, not optional)
1077**CRITICAL**: All sensitivity table cells must be populated programmatically with formulas using openpyxl. DO NOT use linear approximation shortcuts. DO NOT leave placeholder text or notes about manual steps. DO NOT rationalize leaving cells empty because "it's complex" - use a Python loop to generate the formulas.
1079**Table Setup:**
10801. Create table structure with row/column headers (the assumption values to test)
10812. Populate EVERY data cell with a formula that:
1082 - Uses the row header value (e.g., WACC = 9.0%)
1083 - Uses the column header value (e.g., Terminal Growth = 3.0%)
1084 - Recalculates the full DCF with those specific assumptions
1085 - Returns the implied share price for that scenario
10863. All cells must contain working formulas when delivered
10874. Format cells with conditional formatting: Green scale for higher values, red scale for lower values
10885. Bold the base case cell
10896. Leave 1-2 blank rows between tables
1091**No manual intervention required** - the sensitivity tables must be fully functional when the user opens the file.

Sensitivity Analysis (Bottom of DCF Sheet)

TERMINOLOGY REMINDER: "Sensitivity tables" = simple 2D grids with row headers, column headers, and formulas in each data cell. NOT Excel's "Data Table" feature (Data → What-If Analysis → Data Table). You will use openpyxl to write regular Excel formulas into each cell.

Location: Rows 87+ on DCF sheet (NOT a separate sheet)

Three sensitivity tables, vertically stacked:

  1. WACC vs Terminal Growth (rows 87-100) - 5x5 grid = 25 cells with formulas
  2. Revenue Growth vs EBIT Margin (rows 102-115) - 5x5 grid = 25 cells with formulas
  3. Beta vs Risk-Free Rate (rows 117-130) - 5x5 grid = 25 cells with formulas

Total formulas to write: 75 (this is required, not optional)

CRITICAL: All sensitivity table cells must be populated programmatically with formulas using openpyxl. DO NOT use linear approximation shortcuts. DO NOT leave placeholder text or notes about manual steps. DO NOT rationalize leaving cells empty because "it's complex" - use a Python loop to generate the formulas.

Table Setup:

  1. Create table structure with row/column headers (the assumption values to test)
  2. Populate EVERY data cell with a formula that:
  3. Uses the row header value (e.g., WACC = 9.0%)
  4. Uses the column header value (e.g., Terminal Growth = 3.0%)
  5. Recalculates the full DCF with those specific assumptions
  6. Returns the implied share price for that scenario
  7. All cells must contain working formulas when delivered
  8. Format cells with conditional formatting: Green scale for higher values, red scale for lower values
  9. Bold the base case cell
  10. Leave 1-2 blank rows between tables

No manual intervention required - the sensitivity tables must be fully functional when the user opens the file.

Raw lines 1063 to 1092
1093## Case Selector Implementation
1095**Three-Case Framework:**

Case Selector Implementation

Three-Case Framework:

Raw lines 1093 to 1096
1097### Bear Case
1098- Conservative revenue growth (low end of historical range)
1099- Margin compression or no expansion
1100- Higher WACC (risk premium increase)
1101- Lower terminal growth rate
1102- Higher CapEx assumptions

Bear Case

  • Conservative revenue growth (low end of historical range)
  • Margin compression or no expansion
  • Higher WACC (risk premium increase)
  • Lower terminal growth rate
  • Higher CapEx assumptions
Raw lines 1097 to 1103
1104### Base Case
1105- Consensus or management guidance revenue growth
1106- Moderate margin expansion based on operating leverage
1107- Current market-implied WACC
1108- GDP-aligned terminal growth (2.5-3.0%)
1109- Standard CapEx assumptions

Base Case

  • Consensus or management guidance revenue growth
  • Moderate margin expansion based on operating leverage
  • Current market-implied WACC
  • GDP-aligned terminal growth (2.5-3.0%)
  • Standard CapEx assumptions
Raw lines 1104 to 1110
1111### Bull Case
1112- Optimistic revenue growth (high end of projections)
1113- Significant margin expansion
1114- Lower WACC (reduced risk premium)
1115- Higher terminal growth (3.5-5.0%)
1116- Reduced CapEx intensity
1118**Formula Implementation:**
1120**DO NOT use nested IF formulas scattered throughout.** Instead, create a consolidation column that uses INDEX or OFFSET formulas to pull from the appropriate scenario block.
1122**Recommended pattern (using INDEX):**
1123`=INDEX(B10:D10, 1, $B$6)` where `B10:D10` = Bear/Base/Bull values, `1` = row offset, `$B$6` = case selector cell (1, 2, or 3)
1125**Then reference the consolidation column** in all projections:
1126`Revenue Year 1: =D29*(1+$E$10)` where $E$10 is the consolidation column value for Year 1 growth.
1128This approach centralizes scenario logic, making the model easier to audit and maintain.

Bull Case

  • Optimistic revenue growth (high end of projections)
  • Significant margin expansion
  • Lower WACC (reduced risk premium)
  • Higher terminal growth (3.5-5.0%)
  • Reduced CapEx intensity

Formula Implementation:

DO NOT use nested IF formulas scattered throughout. Instead, create a consolidation column that uses INDEX or OFFSET formulas to pull from the appropriate scenario block.

Recommended pattern (using INDEX): =INDEX(B10:D10, 1, $B$6) where B10:D10 = Bear/Base/Bull values, 1 = row offset, $B$6 = case selector cell (1, 2, or 3)

Then reference the consolidation column in all projections: Revenue Year 1: =D29*(1+$E$10) where $E$10 is the consolidation column value for Year 1 growth.

This approach centralizes scenario logic, making the model easier to audit and maintain.

Raw lines 1111 to 1129
1130## Deliverables Structure
1132**File naming**: `[Ticker]_DCF_Model_[Date].xlsx`
1134**Two sheets**:
11351. **DCF** - Complete model with Bear/Base/Bull cases + three sensitivity tables at bottom (WACC vs Terminal Growth, Revenue Growth vs EBIT Margin, Beta vs Risk-Free Rate)
11362. **WACC** - Cost of capital calculation
1138**Key features**: Case selector (1/2/3), consolidation column with INDEX/OFFSET formulas, color-coded cells, cell comments on all inputs, professional borders

Deliverables Structure

File naming: [Ticker]_DCF_Model_[Date].xlsx

Two sheets:

  1. DCF - Complete model with Bear/Base/Bull cases + three sensitivity tables at bottom (WACC vs Terminal Growth, Revenue Growth vs EBIT Margin, Beta vs Risk-Free Rate)
  2. WACC - Cost of capital calculation

Key features: Case selector (1/2/3), consolidation column with INDEX/OFFSET formulas, color-coded cells, cell comments on all inputs, professional borders

Raw lines 1130 to 1139
1140## Best Practices
1142### Model Construction
11431. **Build incrementally**: Complete each section before moving to next
11442. **Test as building**: Enter sample numbers to verify formulas
11453. **Use consistent structure**: Similar calculations follow similar patterns
11464. **Comment complex formulas**: Add notes for unusual calculations
11475. **Build in checks**: Sum checks and balance checks where applicable

Model Construction

  1. Build incrementally: Complete each section before moving to next
  2. Test as building: Enter sample numbers to verify formulas
  3. Use consistent structure: Similar calculations follow similar patterns
  4. Comment complex formulas: Add notes for unusual calculations
  5. Build in checks: Sum checks and balance checks where applicable
Raw lines 1142 to 1148
1149### Documentation
11501. **Document all assumptions**: Explain reasoning behind key inputs
11512. **Cite data sources**: Note where each data point came from
11523. **Explain methodology**: Describe any non-standard approaches
11534. **Flag uncertainties**: Highlight areas with limited visibility

Documentation

  1. Document all assumptions: Explain reasoning behind key inputs
  2. Cite data sources: Note where each data point came from
  3. Explain methodology: Describe any non-standard approaches
  4. Flag uncertainties: Highlight areas with limited visibility
Raw lines 1149 to 1154
1155### Quality Control
11561. **Cross-check calculations**: Verify math in multiple ways
11572. **Stress test assumptions**: Run sensitivity to ensure model is robust
11583. **Peer review**: Have someone else check formulas
11594. **Version control**: Save versions as work progresses

Quality Control

  1. Cross-check calculations: Verify math in multiple ways
  2. Stress test assumptions: Run sensitivity to ensure model is robust
  3. Peer review: Have someone else check formulas
  4. Version control: Save versions as work progresses
Raw lines 1155 to 1160
1161## Common Variations

Common Variations

Raw lines 1161 to 1162
1163### High-Growth Technology Companies
1164- Longer projection period (7-10 years)
1165- Higher initial growth rates (20-30%)
1166- Significant margin expansion over time
1167- Higher WACC (12-15%)
1168- Model unit economics (users, ARPU, etc.)

High-Growth Technology Companies

  • Longer projection period (7-10 years)
  • Higher initial growth rates (20-30%)
  • Significant margin expansion over time
  • Higher WACC (12-15%)
  • Model unit economics (users, ARPU, etc.)
Raw lines 1163 to 1169
1170### Mature/Stable Companies
1171- Shorter projection period (3-5 years)
1172- Modest growth rates (GDP +1-3%)
1173- Stable margins
1174- Lower WACC (7-9%)
1175- Focus on cash generation and capital allocation

Mature/Stable Companies

  • Shorter projection period (3-5 years)
  • Modest growth rates (GDP +1-3%)
  • Stable margins
  • Lower WACC (7-9%)
  • Focus on cash generation and capital allocation
Raw lines 1170 to 1176
1177### Cyclical Companies
1178- Model through economic cycle
1179- Normalize margins at mid-cycle
1180- Consider trough and peak scenarios
1181- Adjust beta for cyclicality

Cyclical Companies

  • Model through economic cycle
  • Normalize margins at mid-cycle
  • Consider trough and peak scenarios
  • Adjust beta for cyclicality
Raw lines 1177 to 1182
1183### Multi-Segment Companies
1184- Separate DCFs for each business unit
1185- Different growth rates and margins by segment
1186- Sum-of-parts valuation
1187- Consider synergies

Multi-Segment Companies

  • Separate DCFs for each business unit
  • Different growth rates and margins by segment
  • Sum-of-parts valuation
  • Consider synergies
Raw lines 1183 to 1188
1189## Troubleshooting
1191**If you encounter errors or unreasonable results, read [TROUBLESHOOTING.md](./TROUBLESHOOTING.md) for detailed debugging guidance.**

Troubleshooting

If you encounter errors or unreasonable results, read TROUBLESHOOTING.md for detailed debugging guidance.

Raw lines 1189 to 1192
Reads a file ./TROUBLESHOOTING.md :1191
1193## Workflow Integration

Workflow Integration

Raw lines 1193 to 1194
1195### At Start of DCF Build
11971. **Gather market data**:
1198 - Check for available MCP servers for current market data
1199 - Use web search/fetch for stock prices, beta, and other market metrics
1200 - Request from user if specific data is needed
12022. **Gather historical financials**:
1203 - Check for available MCP servers (Daloopa, etc.)
1204 - Request from user if not available via MCP
1205 - Manual extraction from 10-Ks if necessary
12073. **Begin model construction** using the DCF methodology detailed in this skill

At Start of DCF Build

  1. Gather market data:
  2. Check for available MCP servers for current market data
  3. Use web search/fetch for stock prices, beta, and other market metrics
  4. Request from user if specific data is needed
  1. Gather historical financials:
  2. Check for available MCP servers (Daloopa, etc.)
  3. Request from user if not available via MCP
  4. Manual extraction from 10-Ks if necessary
  1. Begin model construction using the DCF methodology detailed in this skill
Raw lines 1195 to 1208
Uses an outside tool MCP :1198
1209### During Model Construction
12111. **Build Excel model** using openpyxl with formulas (not hardcoded values)
12122. **Follow xlsx skill conventions** for formula construction and formatting
12133. **Apply fill colors only if requested** by user or if specific brand guidelines are provided

During Model Construction

  1. Build Excel model using openpyxl with formulas (not hardcoded values)
  2. Follow xlsx skill conventions for formula construction and formatting
  3. Apply fill colors only if requested by user or if specific brand guidelines are provided
Raw lines 1209 to 1214
1215### Before Delivering Model (MANDATORY)
12171. **Verify structure**:
1218 - Scenario blocks for Bear/Base/Bull with assumptions across projection years
1219 - Case selector functional with formulas referencing correct scenario blocks
1220 - Sensitivity tables at bottom of DCF sheet (not separate sheet)
1221 - Font colors: Blue inputs, black formulas, green sheet links
1222 - Cell comments on ALL hardcoded inputs
1223 - Professional borders around major sections
12252. **Recalculate formulas**: Run `python recalc.py model.xlsx 30`
12273. **Check output**:
1228 - If `status` is `"success"` → Continue to step 4
1229 - If `status` is `"errors_found"` → Check `error_summary` and read [TROUBLESHOOTING.md](./TROUBLESHOOTING.md) for debugging guidance
12314. **Fix errors and re-run recalc.py** until status is "success"
12335. **Spot-check formulas**:
1234 - Test one FCF formula - does it reference the correct assumption rows?
1235 - Change case selector - does the consolidation column update properly?
1236 - Verify revenue formulas reference consolidation column (not nested IF formulas)
12386. **Deliver model**

Before Delivering Model (MANDATORY)

  1. Verify structure:
  2. Scenario blocks for Bear/Base/Bull with assumptions across projection years
  3. Case selector functional with formulas referencing correct scenario blocks
  4. Sensitivity tables at bottom of DCF sheet (not separate sheet)
  5. Font colors: Blue inputs, black formulas, green sheet links
  6. Cell comments on ALL hardcoded inputs
  7. Professional borders around major sections
  1. Recalculate formulas: Run python recalc.py model.xlsx 30
  1. Check output:
  2. If status is "success" → Continue to step 4
  3. If status is "errors_found" → Check error_summary and read TROUBLESHOOTING.md for debugging guidance
  1. Fix errors and re-run recalc.py until status is "success"
  1. Spot-check formulas:
  2. Test one FCF formula - does it reference the correct assumption rows?
  3. Change case selector - does the consolidation column update properly?
  4. Verify revenue formulas reference consolidation column (not nested IF formulas)
  1. Deliver model
Raw lines 1215 to 1239
Runs code python recalc.py :1225
Reads a file ./TROUBLESHOOTING.md :1229
1240### Available Data Sources
1242- **MCP servers**: If configured (Daloopa for historical financials)
1243- **Web search/fetch**: For current stock prices, beta, and market data
1244- **User-provided data**: Historical financials, consensus estimates
1245- **Manual extraction**: SEC EDGAR filings as fallback

Available Data Sources

  • MCP servers: If configured (Daloopa for historical financials)
  • Web search/fetch: For current stock prices, beta, and market data
  • User-provided data: Historical financials, consensus estimates
  • Manual extraction: SEC EDGAR filings as fallback
Raw lines 1240 to 1246
Uses an outside tool MCP :1242
1247## Final Output Checklist
1249Before delivering DCF model:
1251**Required:**
1252- Run `python recalc.py model.xlsx 30` until status is "success" (zero formula errors)
1253- Two sheets: DCF (with sensitivity at bottom), WACC
1254- Font colors: Blue=inputs, Black=formulas, Green=sheet links
1255- Cell comments on ALL hardcoded inputs
1256- Sensitivity tables fully populated with formulas
1257- Professional borders around major sections
1259**Validation:**
1260- OpEx based on revenue (not gross profit)
1261- Terminal value 50-70% of EV
1262- Terminal growth < WACC
1263- Tax rate 21-28%
1264- File naming: `[Ticker]_DCF_Model_[Date].xlsx`

Final Output Checklist

Before delivering DCF model:

Required:

  • Run python recalc.py model.xlsx 30 until status is "success" (zero formula errors)
  • Two sheets: DCF (with sensitivity at bottom), WACC
  • Font colors: Blue=inputs, Black=formulas, Green=sheet links
  • Cell comments on ALL hardcoded inputs
  • Sensitivity tables fully populated with formulas
  • Professional borders around major sections

Validation:

  • OpEx based on revenue (not gross profit)
  • Terminal value 50-70% of EV
  • Terminal growth < WACC
  • Tax rate 21-28%
  • File naming: [Ticker]_DCF_Model_[Date].xlsx
Raw lines 1247 to 1264
Runs code python recalc.py :1252

From anthropics/financial-services at 6056506, 2026-10-28. Skills read by DeepSeek V4.1 Flash on 2026-11-04. Summary and techniques by Claude Opus 5.5 on 2026-11-06.