How to calculate Rule of 40
The Rule of 40 adds a company's revenue growth rate to its profit margin as a quick check on the balance between growth and profitability.
Formula
Rule of 40 score = revenue growth rate (%) + profit margin (%), commonly free cash flow or EBITDA marginSQL query
This example assumes: annual_financials(year int, revenue numeric, free_cash_flow numeric). It is written in PostgreSQL syntax; date functions differ slightly in MySQL, BigQuery and SQLite, and your column names will differ from these.
SELECT year,
100.0 * (revenue - LAG(revenue) OVER (ORDER BY year))
/ NULLIF(LAG(revenue) OVER (ORDER BY year), 0) AS growth_pct,
100.0 * free_cash_flow / NULLIF(revenue, 0) AS margin_pct,
100.0 * (revenue - LAG(revenue) OVER (ORDER BY year))
/ NULLIF(LAG(revenue) OVER (ORDER BY year), 0)
+ 100.0 * free_cash_flow / NULLIF(revenue, 0) AS rule_of_40_score
FROM annual_financials
ORDER BY year;Common mistakes that make Rule of 40 wrong
- Say which margin you used: free cash flow margin and EBITDA margin give different scores.
- The first year has no prior year, so its growth and score are null.
- Annual figures hide quarterly swings; the rule is a rough screen, not a precise measure.
Ask for Rule of 40 in plain English
Instead of writing the query yourself, you can type the question. SchemaChat turns it into SQL against your connected database or uploaded file, runs it, and shows the SQL and the figures it used so you can check the answer before you share it. It does not replace your judgement about the definition: check that the query matches the formula your business uses.
- What was our Rule of 40 score for each of the last 5 years?
- How did free cash flow margin change year over year?