Magic Formula Calculator
- Capital employed = net working capital $80,000,000.00 + net fixed assets $120,000,000.00 = $200,000,000.00 — the tangible capital the business actually runs on.
- Return on capital = EBIT / capital employed = $50,000,000.00 / $200,000,000.00 = 25.00%.
- Earnings yield = EBIT / enterprise value = $50,000,000.00 / $400,000,000.00 = 12.50% — the business's earnings priced like a bond yield.
- Greenblatt's system ranks every stock on the two measures separately and adds the ranks; the cheapest high-return names rise to the top — the formula buys good businesses at bargain prices, in that order.
A magic formula calculator applies Joel Greenblatt's magic formula to rank stocks on two measures: return on capital, calculated as EBIT divided by capital employed, and earnings yield, calculated as EBIT divided by enterprise value. Capital employed here is net working capital plus net fixed assets, the tangible capital the business runs on, deliberately excluding goodwill and excess cash. The formula uses EBIT rather than net income so companies with different tax and debt loads compare on operating merit alone. Each stock is ranked on both measures separately and the ranks are added; the best combined ranks form the portfolio. The system screens out financials and utilities, whose capital structures break the two ratios' meaning.
Greenblatt's backtests (1988-2004, US large caps) reported about 30% annual returns for the top-ranked group versus about 12% for the market, with multi-year stretches of underperformance inside that record. This method is the accepted standard for this kind of calculation because it uses objective, widely available financial inputs and treats every company on the same operating basis. This page shows the formula, step-by-step workings, worked examples and sources.
Worked examples
Cash-rich value candidate
Primary result: 25.00% — A 25.00% return on capital with a 12.50% earnings yield — the exact profile Greenblatt's screen hunts for. (50000000 · 400000000 · 80000000 · 120000000)
| Return on capital (magic formula) | 25.00% |
| Earnings yield | 12.50% |
| Capital employed | $200,000,000.00 |
| EBIT | $50,000,000.00 |
Quality compounder
Primary result: 30.00% — ROC of 30.00% but an earnings yield of only 4.00%: a great business at a not-so-cheap price. (12000000 · 300000000 · 30000000 · 10000000)
| Return on capital (magic formula) | 30.00% |
| Earnings yield | 4.00% |
| Capital employed | $40,000,000.00 |
| EBIT | $12,000,000.00 |
Mega-cap cash machine
Primary result: 40.00% — 40.00% ROC and a 12.50% earnings yield at mega-cap scale — rare, and worth a second look. (200000000 · 1600000000 · 150000000 · 350000000)
| Return on capital (magic formula) | 40.00% |
| Earnings yield | 12.50% |
| Capital employed | $500,000,000.00 |
| EBIT | $200,000,000.00 |
The two legs of the magic formula
Joel Greenblatt's magic formula ranks stocks on two measures: return on capital (EBIT divided by capital employed) and earnings yield (EBIT divided by enterprise value). The first leg measures business quality, while the second measures price. A magic formula calculator needs both numbers to rank a stock the way Greenblatt intended, because a great business at a terrible price and a cheap business with poor returns on capital can both destroy your money over time.
Return on capital answers a simple question: how much operating profit does the business generate from the tangible capital it runs on? Capital employed here is net working capital plus net fixed assets, deliberately excluding goodwill and excess cash. That exclusion matters. It strips out what a company paid for acquisitions and hoarded cash, leaving the productive assets the business actually uses day to day. When a company earns a high return on that lean base, it is converting capital into profit efficiently. That is the quality leg of the formula.
Earnings yield answers the other question: how much operating profit are you buying per dollar of enterprise value? Enterprise value includes debt as well as equity, so the ratio reflects what the entire business costs, not just the stock price. A high earnings yield means the market is pricing the company's profits cheaply. That is the price leg. The formula uses EBIT rather than net income so companies with different tax and debt loads compare on operating merit alone. Without that adjustment, a heavily leveraged firm could look artificially cheap or expensive simply because of how it is financed.
Greenblatt insists on both measures together because quality and price each protect against the other's weakness. A company with a high return on capital can still be overpriced, and a company with a high earnings yield can still be a value trap burning through capital. Each stock is ranked on both measures separately and the ranks are added; the best combined ranks form the portfolio. Greenblatt's backtests (1988-2004, US large caps) reported about 30% annual returns for the top-ranked group versus about 12% for the market, with multi-year stretches of underperformance inside that record. The system also screens out financials and utilities, whose capital structures break the two ratios' meaning.
How the ranking actually works
A magic formula calculator takes Joel Greenblatt's two ranking measures and applies them to every stock in the eligible universe, one at a time. The first measure is return on capital, defined as EBIT divided by capital employed. Capital employed here is net working capital plus net fixed assets — the tangible capital the business runs on, deliberately excluding goodwill and excess cash. The second measure is earnings yield, defined as EBIT divided by enterprise value. The formula uses EBIT rather than net income so companies with different tax and debt loads compare on operating merit alone.
Each stock is ranked on both measures separately and the ranks are added; the best combined ranks form the portfolio. A stock that ranks 10th on return on capital and 25th on earnings yield gets a combined score of 35, which is compared against every other stock's combined score. The lowest combined numbers win, and the top-ranked group is what you buy. The system screens out financials and utilities, whose capital structures break the two ratios' meaning.
Greenblatt's backtests (1988-2004, US large caps) reported about 30% annual returns for the top-ranked group versus about 12% for the market — with multi-year stretches of underperformance inside that record. Those dry spells are why the holding period matters as much as the ranking itself. The strategy calls for rebalancing yearly, holding each batch of top-ranked stocks for roughly a year before replacing them with the new top group. Sticking with that schedule lets losers roll off at a long-term capital gains rate in many cases rather than a short-term rate, and it keeps transaction costs and turnover from eating the edge the ranking is meant to capture.
The yearly cadence also works against the temptation to abandon the method after a bad stretch. Because the formula can lag for years before catching up, an investor who jumps in and out based on recent performance misses the recovery that made the backtest numbers work in the first place. The ranking does the stock selection; the discipline of holding and rebalancing on a fixed schedule does the rest.
What the backtests showed — and their limits
Joel Greenblatt's published backtests cover 1988 through 2004 and focus on U.S. large caps. In that period, the top-ranked group selected by his method reported about 30% annual returns, compared with about 12% for the market as a whole. Those are striking numbers, and they are the main reason the magic formula attracted such wide attention when Greenblatt published them. A magic formula calculator built on the same logic aims to reproduce that ranking process stock by stock.
What the headline figures can obscure, though, is that the strong long-run average included multi-year stretches of underperformance. The top-ranked group did not beat the market every year or even over every two- or three-year window. Inside the same 1988-2004 record that produced the roughly 30% average, there were periods when the formula trailed the market long enough that many investors would have abandoned it. Greenblatt himself made this point: the strategy works, in his view, because most people will not stick with it through the lagging stretches. The backtest shows the destination, not the ride.
The results also carry a structural tilt worth naming. The formula ranks stocks on two measures — return on capital, calculated as EBIT divided by capital employed, and earnings yield, calculated as EBIT divided by enterprise value. Capital employed here means net working capital plus net fixed assets, the tangible capital the business runs on, and it deliberately excludes goodwill and excess cash. Each stock is ranked on both measures separately, the ranks are added, and the best combined ranks form the portfolio. Because high returns on tangible capital are easier to find among smaller companies, the selected group tends to lean toward small caps even when the starting universe is large caps. That small-cap tilt is part of how the backtest achieved its numbers, and it means the formula is not a pure test of stock-picking skill independent of company size.
Two screening choices shape the comparison further. The formula uses EBIT rather than net income so that companies with different tax and debt loads compare on operating merit alone. It also excludes financials and utilities, because their capital structures break the meaning of the two ratios. Those choices are reasonable, but they mean the backtest is not testing the formula across the whole market — it is testing it on a filtered subset.
Finally, the most important limit: a backtest is a look at how a rule would have performed in the past, not a promise of how it will perform going forward. Markets change, competition among investors changes, and the small-cap effect that helped the 1988-2004 results may not repeat in the same way. The magic formula calculator gives you the ranking logic; it cannot give you a guarantee.
Where the formula breaks down
A magic formula calculator can rank stocks mechanically, but the inputs assume the business has a recognizable operating core. Joel Greenblatt's system screens out financials and utilities outright because their balance sheets do not separate operating assets from financing in a way the two ratios can read. A bank's capital employed is not comparable to a manufacturer's, and a utility's regulated structure distorts return on capital. The formula works best on companies that buy assets, turn them through operations, and generate earnings — not on entities whose capital structures break that logic.
The denominator of return on capital is capital employed: net working capital plus net fixed assets, the tangible capital the business runs on, deliberately excluding goodwill and excess cash. When a company reports negative net working capital or negative capital employed, the ratio stops behaving. A retailer with large supplier credit can show negative working capital; a business that has spun off assets or written down fixed assets can show a small or negative denominator. EBIT divided by a negative number produces a negative return on capital that ranks below mediocre businesses, even when the operations are strong. A magic formula calculator will place that stock poorly, and the rank will not reflect the underlying economics.
EBIT is used rather than net income so companies with different tax and debt loads compare on operating merit alone. That choice helps comparability, but it also leaves the ratio exposed to one-off operating distortions. A large asset sale, a restructuring gain, or a temporary cost spike can push EBIT well above or below its normal level for a year. Because the formula reads only one year of each measure, the rank captures the distortion as if it were sustainable. A company whose EBIT is temporarily inflated will rank high on both return on capital and earnings yield, and a company whose EBIT is temporarily depressed will rank low — regardless of what normalized earnings look like.
Share buybacks can warp the capital base from the other side. A company buying back stock aggressively reduces equity, which lowers enterprise value relative to earnings and can improve the earnings yield rank. If the buybacks are funded with cash or debt, the effect on capital employed and enterprise value can make the stock look cheaper than the underlying business supports. The formula does not distinguish between a company that is genuinely undervalued and one whose capital base has been mechanically reduced through repurchases. Greenblatt's backtests (1988-2004, US large caps) reported about 30% annual returns for the top-ranked group versus about 12% for the market, but those results included multi-year stretches of underperformance — periods when the formula's blind spots showed up in the ranks.
FAQs
What is the magic formula?
Joel Greenblatt's stock-ranking system: order companies by return on capital and by earnings yield, add the two ranks, and buy the names with the best combined score.
How is return on capital calculated in the magic formula?
Return on capital is EBIT divided by capital employed, where capital employed is net working capital plus net fixed assets. This measures how efficiently a company generates operating profits from the capital tied up in its business operations.
How is earnings yield calculated?
Earnings yield is EBIT divided by enterprise value — the operating earnings you get for the whole company's market price including its debt position. This lets you compare what you pay for the entire business, not just the equity slice.
Why does the formula use EBIT?
EBIT strips out tax and financing differences, so the ranking compares businesses on operations rather than capital structure. This means companies with different debt levels or tax rates are judged on an even playing field based purely on operating performance.
Does the magic formula still work?
Its edge has narrowed as it became famous, and it can lag the market for years at a time. Greenblatt himself frames it as a discipline for patient investors, not a shortcut. Sticking with it through underperformance is part of the approach.
Which stocks does the magic formula exclude?
The magic formula excludes financial companies and utilities, plus any company whose capital employed or enterprise value makes the ratios meaningless. These sectors have balance sheets and business models that do not fit the formula's underlying comparisons cleanly.