Joel Greenblatt's Magic Formula
Reading time: ~15 min
Introduction
In 2005, investor and professor Joel Greenblatt published "The Little Book That Beats the Market," a short and accessible book that introduced the public to a quantitative strategy called the Magic Formula. The book quickly became a bestseller and an essential reference for value investors around the world.
Greenblatt's premise is elegantly simple: if you could find excellent companies selling at bargain prices, your long-term returns would be extraordinary. The Magic Formula is the systematization of this idea — a mechanical, replicable approach that any investor can follow.
Who is Joel Greenblatt?
Joel Greenblatt is an American investor, hedge fund manager, professor, and author. He is the founder of Gotham Capital, an investment fund that achieved average annual returns of about 40% over 20 years (1985–2005). Greenblatt is an adjunct professor at Columbia Business School, one of the most prestigious finance institutions in the world — the same school where Benjamin Graham, the father of value investing, taught decades earlier.
Beyond "The Little Book That Beats the Market," Greenblatt authored other influential books, including "You Can Be a Stock Market Genius" and "The Big Secret for the Small Investor." His work is recognized for democratizing investment concepts that were previously restricted to Wall Street professionals.
What is the Magic Formula?
The Magic Formula is a quantitative investment strategy based on two fundamental principles of value investing:
- Buy cheap — find stocks that are undervalued by the market relative to what they actually earn.
- Buy quality — prioritize companies that are efficient at generating profits from invested capital.
The genius lies in the combination: by ranking all stocks in the market by these two criteria and summing the positions, the formula automatically identifies companies with the best quality-to-price ratio.
The Two Key Metrics
How the Ranking System Works
The Magic Formula's mechanics follow a step-by-step ranking process:
Rank by Earnings Yield
All eligible stocks are sorted from highest to lowest Earnings Yield. The cheapest stock gets rank 1, the second cheapest rank 2, and so on.
Rank by Return on Capital
The same process is done for Return on Capital. The most efficient company gets rank 1.
Sum the ranks
For each stock, the two ranks are added together. A company ranked 5th in Earnings Yield and 10th in Return on Capital will have a combined score of 15.
Select the top stocks
Stocks with the lowest combined score are the winners — they represent the best combinations of low price and high quality. Typically, the top 20-30 stocks form the portfolio.
Stocks Excluded from the Formula
Greenblatt explicitly excludes two sectors. A third one falls out as a consequence, and it is worth understanding why:
Financial Companies
Banks, insurers, brokerages, and other financial institutions are excluded because the nature of their balance sheets makes EBIT and Enterprise Value metrics less meaningful. The leverage inherent to the financial sector distorts the calculations.
Utility Companies
Electric, water, gas, and sanitation companies are excluded because they operate in highly regulated environments. Their profits are controlled by the government, making the formula's metrics less relevant for identifying value.
Real Estate Companies
Malls, developers, and real estate investment trusts (REITs) are left out too — and here the reason is historical. Greenblatt does not name the sector, because under the classification in force when he wrote the book, in 2005, real estate sat inside “Financials”. Only in September 2016 did it become a sector of its own, the first created since 1999. Excluding “financials” back then already removed REITs along with it.
The mechanical reason is the same as for banks: a REIT is leveraged by design and depreciates property heavily, distorting EBIT and Enterprise Value in the same way.
In the simulator, these three sectors appear in the filters already checked and cannot be unchecked: this is the formula as the book defines it, not a preference of ours. Every other sector is yours to choose.
Additionally, ADRs (foreign stock receipts), companies with very low market capitalization (micro caps), and companies with incomplete financial data are also typically excluded to ensure result quality.
Historical Performance
The backtesting results presented by Greenblatt are impressive:
| Metric | Magic Formula | S&P 500 |
|---|---|---|
| Average annual return (1988–2004) | ~30.8% | ~12.4% |
| Test period | 17 years (1988–2004) | |
| $10,000 invested in 1988 | ~US$1.000.000 | ~US$73.000 |
These numbers show that the Magic Formula would have turned $10,000 into approximately $1,000,000 in 17 years, while the same amount invested passively in the S&P 500 would have reached about $73,000. Subsequent studies in different markets around the world — including Europe, Japan, and emerging markets — have shown consistently superior results.
Why Does the Formula Work?
The Magic Formula's effectiveness rests on three pillars:
- Short-term market inefficiency: The market frequently overreacts to temporary negative news, pushing the price of good companies down. The formula captures these opportunities.
- Investor behavioral biases: Most investors follow the crowd, buy trendy stocks, and sell in panic. A mechanical approach eliminates these emotions.
- Mean reversion: Temporarily undervalued companies tend to return to their fair value over time, generating gains for those who bought cheap.
Practical Tips for Applying the Formula
Diversify
Buy 20 to 30 stocks from the top of the ranking to reduce the risk of any individual company.
Rebalance annually
Greenblatt recommends holding each stock for about a year, then rebalancing the portfolio with new ranking positions.
Be disciplined
The formula will suggest unpopular stocks ignored by the market. Trust the process, not your emotions.
Be patient
The strategy may underperform the market for 1-2 consecutive years. Superior results typically appear over 3-5+ year horizons.
Start with simulation
Before investing real money, use our simulator to test the strategy with historical data and build confidence.
Consider taxes
Depending on your jurisdiction, selling stocks at a profit may have tax implications. Plan rebalancing considering the tax impact.
Limitations and Caveats
Like any investment strategy, the Magic Formula has limitations you need to be aware of:
- Not infallible: The formula can select companies that are cheap for good reasons ("value traps") — companies in structural decline whose prices keep falling.
- Periods of underperformance: In strong growth bull markets, the formula may lag indices like the S&P 500. Greenblatt acknowledges that in 5 out of every 12 months, the formula may lose to the market.
- Accounting data looks backward: The metrics use historical financial data, which may not reflect the company's current or future situation.
- Adaptation to Brazilian market: Different markets have unique characteristics (lower liquidity, sector concentration, currency) that may affect results. The formula was originally tested with American stocks.
- Requires emotional discipline: The biggest risk is the investor abandoning the strategy after a bad period, exactly when it's about to recover.
Ready to test the Magic Formula?
Use our free simulator to apply the Magic Formula with real data from the Brazilian and American markets. See how your portfolio would have performed over the years.
Open the Simulator