Как посчитать EBITDA в SQL
Содержание:
Зачем EBITDA
EBITDA = Earnings Before Interest, Taxes, Depreciation, Amortization. Approximation of cash flow generated by operations. Standard metric для valuation (EV / EBITDA multiple).
Формула
EBITDA = Net Income + Interest + Taxes + Depreciation + Amortization
или
EBITDA = Operating Income + Depreciation + AmortizationБазовый расчёт
WITH pnl AS (
SELECT
DATE_TRUNC('quarter', DATE) AS quarter,
SUM(net_income) AS net_income,
SUM(interest_expense) AS interest,
SUM(tax_expense) AS taxes,
SUM(depreciation) AS depreciation,
SUM(amortization) AS amortization,
SUM(revenue) AS revenue
FROM quarterly_financials
WHERE DATE >= CURRENT_DATE - INTERVAL '12 months'
GROUP BY 1
)
SELECT
quarter,
net_income + interest + taxes + depreciation + amortization AS ebitda,
revenue,
(net_income + interest + taxes + depreciation + amortization)::NUMERIC * 100
/ NULLIF(revenue, 0) AS ebitda_margin_pct
FROM pnl
ORDER BY quarter;EBITDA Margin
EBITDA Margin = EBITDA / Revenue × 100%.
SELECT
SUM(revenue) AS revenue,
SUM(ebit + depreciation + amortization) AS ebitda,
SUM(ebit + depreciation + amortization)::NUMERIC * 100 / NULLIF(SUM(revenue), 0) AS ebitda_margin
FROM financials
WHERE DATE >= '2026-01-01' AND DATE < '2026-04-01';EBITDA vs Operating Income
| Метрика | Что вычитается / добавляется |
|---|---|
| Operating Income (EBIT) | Revenue - COGS - OpEx |
| EBITDA | EBIT + Depreciation + Amortization |
D&A — non-cash. EBITDA closer к cash flow.
EV / EBITDA multiple
Standard valuation:
EV = Market Cap + Debt - Cash
EV / EBITDA = valuation multipleSaaS: 10-20x EBITDA. Industrials: 6-10x.
Adjusted EBITDA
«Adjusted» — exclude non-recurring items (restructuring, M&A costs, stock-based comp):
SELECT
revenue,
ebitda,
-- Adjusted (add back non-recurring)
ebitda + restructuring + ma_costs + sbc AS adjusted_ebitda,
adjusted_ebitda::NUMERIC * 100 / revenue AS adj_ebitda_margin
FROM financials
WHERE DATE = CURRENT_DATE - INTERVAL '1 quarter';⚠️ «Adjusted» often abused — SBC routinely excluded (controversial для tech).
Частые ошибки
Ошибка 1. EBITDA = Cash Flow. EBITDA approximates, не equals. Working capital, capex differences.
Ошибка 2. Adjusted EBITDA without justification. Aggressive add-backs make company look profitable. Skeptical look needed.
Ошибка 3. Include / exclude SBC. Stock-based comp = real cost. Excluding it = optimistic.
Ошибка 4. Capex not subtracted. Capital-intensive businesses look great в EBITDA. Doesn't reflect reinvestment needs.
Ошибка 5. Negative EBITDA в early-stage. Normal для startup. Don't apply mature-company logic.
Связанные темы
- Как посчитать operating margin в SQL
- Как посчитать gross margin в SQL
- Как посчитать net margin в SQL
- Как посчитать revenue в SQL
FAQ
EBITDA vs Net Income?
Net Income = bottom line (after all expenses). EBITDA = before D&A, interest, taxes.
EBITDA Margin sector?
SaaS: 20-30%. Hardware: 10-15%. Banking: N/A (different metric).
Why EBITDA controversial?
Buffett: «EBITDA is bullshit». D&A real cost in long-run. Capital allocation hidden.
Adjusted EBITDA когда use?
For comparing companies with different one-time items. Use carefully.
EV / EBITDA range?
10-15x — average. <8x — value play. >20x — growth premium.