Skip to main content
Value Investing

Magic Formula Stock Screener: A Step-by-Step Tutorial for Investors

JS
Written by Javier Sanz
7 min read
Share:

Magic Formula Stock Screener: A Step-by-Step Tutorial for Investors

magic formula stock screener — chart and analysis

A magic formula stock screener ranks every stock in your universe by two numbers: earnings yield and return on capital. Joel Greenblatt published the method in "The Little Book That Still Beats the Market" and showed that a simple combined ranking of those two factors produced above-market returns over 17 years of back-testing. The screener does the mechanical work of sorting; your job is to apply judgment to the output. This tutorial walks through each step, from setting up your filters to building a final watchlist.

Key Takeaways

  • The magic formula ranks stocks by earnings yield (EBIT / enterprise value) and return on capital (EBIT / net working capital plus net fixed assets), then adds the two rankings to produce a combined score.
  • Lower combined scores are better. A stock ranked 5th on earnings yield and 8th on return on capital scores 13, which beats a stock ranked 20th on both.
  • Greenblatt's original back-test covered 1988 to 2004 on U.S. stocks above $50 million market cap and showed roughly 30.8% annualized returns versus 12.4% for the S&P 500.
  • The strategy underperforms in 1 out of every 4 calendar years, which is why most investors abandon it before the long-run edge materializes.
  • You can run the magic formula stock screener on ValueMarkers and cross-reference outputs with VMCI scores to filter out stocks that pass the formula but fail on integrity or balance-sheet risk.
  • Greenblatt excludes financials and utilities because their capital structures make return on capital calculations meaningless.

What the Magic Formula Actually Measures

Earnings yield is EBIT divided by enterprise value, not net income divided by market cap. The distinction matters. Using enterprise value accounts for debt, so a company with $500 million of EBIT, $2 billion of equity market cap, and $1 billion of net debt has an earnings yield of 500/3000, about 16.7%. Using just market cap would give a misleading 25%. EBIT also strips out interest and tax differences, making comparisons across companies with different capital structures fair.

Return on capital is EBIT divided by the sum of net working capital and net fixed assets. This measures how much operating profit the business generates per dollar of capital actually deployed in the business, excluding excess cash and goodwill. A company with $500 million of EBIT and $1 billion of tangible capital earns a 50% return on capital. Apple (AAPL) consistently produces ROIC above 45%, which is why it tends to appear near the top of return-on-capital rankings even at a P/E of 28.3.

Step 1: Define Your Universe

Open the ValueMarkers guru tracker and set your initial filters before running the magic formula ranking.

Market cap floor: Greenblatt used $50 million in 2006. Adjusted for inflation and liquidity, most practitioners today set the floor at $250 million to $500 million. Small-cap magic formula portfolios work in theory but fail in practice because bid-ask spreads erode returns on positions you cannot easily enter or exit.

Exchange: The original formula applied to U.S. stocks. ValueMarkers covers 73 global exchanges, so you can run the same ranking on European, Asian, or emerging-market universes. Keep one region per screen to avoid comparing earnings yields across wildly different interest-rate environments.

Exclude sectors: Remove financials (banks, insurance, asset managers) and utilities. Both sectors use leverage as a core business input, which makes the EBIT / capital calculation produce numbers that are not comparable to industrials or consumer companies.

Step 2: Set the Two Core Filters

With your universe defined, apply the two ranking variables.

Earnings yield filter: Set a minimum earnings yield of 5% as a starting gate. This removes the most expensive names before ranking begins and keeps your output list manageable. At 5% earnings yield you are paying no more than 20x EBIT on an enterprise-value basis, which already filters out the majority of speculative growth stocks.

Return on capital filter: Set a minimum of 15%. Anything below this threshold is a mediocre business by Greenblatt's framework. The 15% floor ensures you are only looking at companies where the business model genuinely earns above its cost of capital.

FilterParameterRationale
Market capMore than $250 millionLiquidity; bid-ask spread risk below this level
Sectors excludedFinancials, utilitiesEBIT / capital is not comparable
Earnings yieldAt least 5% (EBIT / EV)Removes overpriced names before ranking
Return on capitalAt least 15% (EBIT / tangible capital)Removes low-quality businesses
Geographic scopeOne region per screenAvoids cross-rate distortion
Minimum history3 years of EBIT dataEnsures one full business cycle visible

Step 3: Rank and Combine the Scores

Sort all qualifying stocks from highest earnings yield to lowest. Assign each stock a rank: the highest earnings yield gets rank 1, the next gets rank 2, and so on. Then sort again by return on capital from highest to lowest and assign a second set of ranks. Add the two ranks together for each stock. The stocks with the lowest combined scores are the magic formula candidates.

A worked example: Johnson and Johnson (JNJ) trades at a trailing P/E near 15.4 with a dividend yield of 3.1%. On an enterprise-value basis, assuming debt of roughly $35 billion and EBIT near $8 billion, the earnings yield comes to about 7.2%. JNJ's return on capital on tangible assets typically runs above 30%. In a universe of 300 stocks, JNJ might rank 40th on earnings yield and 25th on return on capital, giving a combined score of 65. Whether 65 beats your threshold depends on the full universe you are screening.

Step 4: Apply Integrity Checks

The magic formula is a ranking mechanism, not a fraud filter. A company can score brilliantly on earnings yield and return on capital while carrying accounting red flags, pending litigation, or a CEO who owns no shares. Before adding any name from your top-30 list to a watchlist, run three checks.

Accruals ratio: High accruals relative to operating cash flow suggest earnings that are not backed by cash. Greenblatt's formula uses EBIT, which is accrual-based. A company with $500 million of EBIT and $200 million of free cash flow has a quality problem regardless of its ranking.

Insider ownership: Greenblatt himself has said he prefers to own companies where management has meaningful skin in the game. Check the proxy for ownership as a percentage of total shares outstanding, not just dollar values.

VMCI Integrity pillar: In ValueMarkers, the VMCI score breaks down into five pillars: Value (35%), Quality (30%), Integrity (15%), Growth (12%), and Risk (8%). The Integrity pillar flags earnings manipulation signals, auditor changes, and related-party transactions. A stock with a high magic formula rank but a low Integrity score deserves extra scrutiny before you buy.

Step 5: Size the Portfolio and Set a Rebalance Date

Greenblatt recommended holding 20 to 30 stocks and rebalancing annually. The annual rebalance matters for two reasons. First, it gives time for the market to recognize value that the formula identified. Second, it aligns with tax-loss harvesting: if a position is down after 11 months, selling before the 12-month mark captures a short-term loss; if it is up, waiting until month 12 converts the gain to long-term.

Do not rebalance more frequently. Monthly rebalancing on a magic formula portfolio produces transaction costs that eliminate most of the alpha. Weekly rebalancing is worse. The edge in this strategy comes from holding long enough to let mean reversion work.

How the Magic Formula Compares to Other Screener Approaches

ApproachFactors UsedRebalance FrequencyHistorical Edge
Magic formulaEarnings yield + return on capitalAnnual~18 points per year in Greenblatt's back-test
Simple P/E screenP/E ratio onlyAnnual~4 points per year (Fama-French)
Price-to-bookP/B ratio onlyAnnual~3 points per year
VMCI compositeValue + Quality + Integrity + Growth + RiskQuarterlyComposite scoring across 120+ indicators
Piotroski F-Score9 accounting factorsAnnual~7.5 points per year in original paper

The magic formula's edge comes from combining a valuation factor with a quality factor, which reduces the "value trap" problem that afflicts pure P/E or P/B screens. A stock that is cheap on earnings yield but earns a poor return on capital is probably cheap for a good reason; the formula naturally downgrades it.

Common Mistakes When Running the Screen

Using net income instead of EBIT. Net income is after interest and taxes, which makes companies with different capital structures incomparable. Always use EBIT or EBIT-equivalent in the earnings yield calculation.

Including financial stocks. A bank's "capital" is its loan book, and its "earnings" are net interest margin. Applying the magic formula to a bank produces a number that is meaningless on its own terms. Remove them before ranking.

Chasing the top 5 instead of spreading across 20 to 30. The formula's edge is statistical, not predictive. The 5th-ranked stock does not reliably outperform the 25th-ranked stock in any given year. The edge appears across the full portfolio over multiple years.

Ignoring position sizing. Equal weighting across 20 to 30 names is what Greenblatt modeled. Concentrating 40% of the portfolio in the top three names converts a diversified quant strategy into a concentrated bet and undermines the statistical argument behind the method.

Further reading: SEC EDGAR · Investopedia

Why joel greenblatt magic formula Matters

This section anchors the discussion on joel greenblatt magic formula. The detailed treatment, formula, and worked examples appear in the body of this article above. The points below summarize the most important takeaways for value investors who want to apply joel greenblatt magic formula in real portfolio decisions. ValueMarkers exposes the underlying data on every covered ticker via the screener and stock profile pages, so the concepts in this article translate directly into actionable filters.

Key inputs for joel greenblatt magic formula

See the main discussion of joel greenblatt magic formula in the sections above for the full treatment, including the inputs, the calculation methodology, the typical sector benchmarks, and the most common pitfalls to avoid. The ValueMarkers screener lets value investors filter the full universe of 100,000+ stocks across 73 exchanges using joel greenblatt magic formula alongside the rest of the 120-indicator composite, with sector percentiles and historical trends shown on every stock profile.

Sector benchmarks for joel greenblatt magic formula

See the main discussion of joel greenblatt magic formula in the sections above for the full treatment, including the inputs, the calculation methodology, the typical sector benchmarks, and the most common pitfalls to avoid. The ValueMarkers screener lets value investors filter the full universe of 100,000+ stocks across 73 exchanges using joel greenblatt magic formula alongside the rest of the 120-indicator composite, with sector percentiles and historical trends shown on every stock profile.

Frequently Asked Questions

what happens if the stock market crashes

When the stock market crashes, magic formula portfolios typically fall alongside the broad market because valuation factors do not provide short-term downside protection. In Greenblatt's original back-test, the strategy underperformed in several down years before recovering strongly. The risk is behavioral: most investors sell at the bottom precisely when the formula's cheapest stocks are statistically most attractive.

what time does the stock market open

U.S. stock markets (NYSE and Nasdaq) open at 9:30 a.m. Eastern Time on regular trading days. Pre-market trading begins as early as 4:00 a.m. Eastern through most major brokerages, though volume and liquidity are thin before the official open. Magic formula rebalancing should always execute during regular market hours to avoid wide spreads.

are stock markets closed today

U.S. stock markets close on 11 federal holidays per year, including New Year's Day, Martin Luther King Jr. Day, Presidents' Day, Good Friday, Memorial Day, Juneteenth, Independence Day, Labor Day, Thanksgiving, and Christmas. You can check the current trading calendar on the NYSE or Nasdaq websites. Rebalance dates that fall on a holiday should shift to the next trading day.

what time does the stock market close

U.S. stock markets close at 4:00 p.m. Eastern Time. After-hours trading runs from 4:00 p.m. to 8:00 p.m. Eastern through most brokerages. For magic formula rebalancing, execute trades in the last 30 minutes of the regular session rather than after hours, where spreads widen and fills are less predictable.

when does the stock market open

The NYSE and Nasdaq open at 9:30 a.m. Eastern Time, Monday through Friday, except on designated market holidays. The London Stock Exchange opens at 8:00 a.m. GMT. The Tokyo Stock Exchange opens at 9:00 a.m. JST. If you run the magic formula screen on non-U.S. exchanges through ValueMarkers, check the relevant exchange calendar for local open times before placing rebalance orders.

why is the stock market down today

Any single day's decline can have dozens of causes: earnings misses, macroeconomic data releases, Federal Reserve commentary, geopolitical events, or simple liquidity shifts. For magic formula investors, daily moves are largely irrelevant. Greenblatt's data shows the strategy requires a three-to-five-year horizon for the statistical edge to overcome short-term noise. A down day on a name in your portfolio is only worth investigating if the underlying business fundamentals have changed, not because the price fell.

Start running the magic formula today with ValueMarkers' guru tracker, which lets you filter by earnings yield, return on capital, and VMCI score across 73 exchanges in one screen.

Written by Javier Sanz, Founder of ValueMarkers. Last updated April 2026.


Ready to find your next value investment?

ValueMarkers tracks 120+ fundamental indicators across 100,000+ stocks on 73 global exchanges. Run the methodology above in seconds with our stock screener, or see today's top-ranked names on the leaderboard.

Related tools: DCF Calculator · Methodology · Compare ValueMarkers

Disclaimer: This content is for informational and educational purposes only and does not constitute investment advice, a recommendation, or an offer to buy or sell any security. Past performance does not guarantee future results. Consult a licensed financial advisor before making investment decisions.

Related Articles

Value Investing

How to Master Greenblatt Stock Screener [Step-by-Step Guide]

Master the Greenblatt stock screener with this step-by-step guide. Learn how to rank stocks by earnings yield and return on capital to find undervalued, high-quality names.

8 min read

Value Investing

Mastering Ray Dalio Books: A Value Investor's Comprehensive Guide

A comprehensive guide to Ray Dalio books: Principles, Big Debt Crises, and Changing World Order, with actionable frameworks for value investors screening stocks today.

14 min read

Value Investing

Benjamin Graham Explained: What Every Investor Should Know

Benjamin Graham built the intellectual foundation of value investing. This comprehensive analysis covers his life, principles, formulas, and why his methods still produce results.

14 min read

Value Investing

Johnson and Johnson Financial Ratios by the Numbers: A Data Analysis for Investors

A data-driven breakdown of Johnson and Johnson financial ratios, covering valuation, profitability, dividend health, and balance sheet strength across the last decade.

10 min read

Value Investing

The Value Investor's Define Intrinsic Value Checklist

To define intrinsic value precisely: it is the present value of a business's future free cash flows, discounted at a required rate of return.

7 min read

Value Investing

Economic Moat by the Numbers: A Data Analysis for Investors

An economic moat is a durable competitive advantage that protects long-term returns. This data analysis shows how to measure it, rank it, and act on it.

8 min read

Weekly Stock Analysis - Free

5 undervalued stocks, fully modeled. Every Monday. No spam.

Cookie Preferences

We use cookies to analyze site usage and improve your experience. You can accept all, reject all, or customize your preferences.