Margin expansion stock screener excel - if you came in looking for a way to filter the S&P 500 universe down to companies that grew gross, operating, and net margins year-over-year after the Q1 2026 print, this is the framework. Q1 2026 earnings season closed out with a familiar split. Companies that protected pricing and held the line on operating expenses delivered margin expansion. Companies that lost pricing leverage or absorbed labor and freight costs printed margin compression. The market is paying for the first group and de-rating the second. A simple Excel screener built on top of MarketXLS live data lets you score the watchlist on margin level, year-over-year change, and return-on-equity quality, then update it every time a fresh 10-Q hits.
This guide walks through the screener logic, shows the MarketXLS formulas behind every column, and links to two ready-to-use Excel templates (one static sample, one live-formula version). The framework is educational. Use it as one filter on a broader process. It is not a recommendation to buy or sell any security.
Why Margin Expansion Matters After Q1 2026
Margin expansion is the single most reliable indicator that an operating model is working. Revenue can grow because a company is buying volume with discounts. EPS can grow because a company is buying back shares. Margins are harder to fake. If gross margin expanded year-over-year, the company is either getting better pricing, lower input costs, or a richer mix. If operating margin expanded, the company is getting operating leverage on fixed costs. If net margin expanded too, the operating story is flowing through tax and interest. Three expanding lines is a signal worth screening for.
After Q1 2026, three macro pressures shaped the margin picture across the market:
| Pressure | Sectors Most Affected | Margin Reaction |
|---|---|---|
| Labor cost normalization | Retail, restaurants, consumer staples | Mixed - large-cap retailers held margin, smaller players compressed |
| Freight and input cost reset | Industrials, materials, food | Gross margin recovery for those that held pricing |
| AI capex flowing into revenue | Mega-cap tech, semis, hyperscaler suppliers | Operating margin expansion in hardware and software platforms |
The screener in this guide weights names that benefit from all three at the same time. The watchlist starts with 28 large caps spanning every GICS sector so you can compare margin behavior across the index, not just within tech.
Key Margin Metrics in the Screener
The dashboard tracks four margin lines plus a year-over-year change for each. Verify every formula in the MarketXLS Function Docs before relying on the screener with your own ticker list.
| Metric | What It Measures | MarketXLS Formula |
|---|---|---|
| Gross margin | Revenue minus cost of goods sold, divided by revenue | =GrossMargin("AAPL") |
| Operating margin | Operating income divided by revenue | =OperatingMargin("AAPL") |
| EBIT margin | EBIT divided by revenue | =EBITMargin("AAPL") |
| Net profit margin | Net income divided by revenue | =NetProfitMargin("AAPL") |
| Pre-tax profit margin | Pre-tax income divided by revenue | =PreTaxProfitMargin("AAPL") |
| Return on equity | Net income divided by shareholders equity | =ReturnOnEquity("AAPL") |
| Trailing P/E | Price divided by trailing twelve-month EPS | =PERatio("AAPL") |
| Sector | GICS sector classification | =Sector("AAPL") |
| Live price | Most recent traded price | =QM_Last("AAPL") |
Each of these is a single-argument call that takes a ticker symbol in quotes. The screener pulls them into one row per ticker, then derives the year-over-year change and a composite score. The full formula reference lives in a "MarketXLS Functions Used in This Sheet" box at the bottom of every tab in the workbook.
The Margin Quality Score
The composite Margin Quality Score is the screener's headline number. It blends three sub-scores into a 0 to 100 scale so you can rank a watchlist of any size in one glance.
| Sub-Score | Inputs | Default Weight |
|---|---|---|
| Margin Level | Operating margin (vs 40% target) + Net profit margin (vs 30% target) | 40% |
| Margin Expansion | Op margin YoY change + Net margin YoY change (each vs 5pp target) | 35% |
| Quality Kicker | Return on equity (vs 30% target) | 25% |
Weights live in the Inputs sheet so you can re-weight the score without touching the formulas. If you care more about absolute profitability than year-over-year improvement, drag the Margin Level weight to 60% and shrink the Expansion weight. If you want a pure rate-of-change screen, do the opposite. The composite formula in cell M4 of the Margin Dashboard looks like this in plain English:
Score = MarginLevel * Inputs!C11 + MarginExpansion * Inputs!C12 + ROEQuality * Inputs!C13
Each sub-score is clamped between 0 and 100 with the MIN and MAX functions so an outlier on one dimension cannot dominate the total. A 100% operating margin (hypothetical) caps at 100 on the level sub-score rather than pushing the composite above 100. The same goes for a 50 percentage point YoY expansion - a real margin reading at that level would be a measurement error, and the clamp protects the rank order from being distorted.
Reading the Margin Tag Column
Next to the score, every row in the dashboard gets a tag based on year-over-year margin direction. The tag depends on two thresholds set in the Inputs sheet:
| Tag | Rule | Meaning |
|---|---|---|
| Expanding | Op margin YoY change AND Net margin YoY change both above +50bps | Margin story is intact at both the operating and net line |
| Stable | Op margin YoY change between -50bps and +50bps | No material change, watch for a trend break |
| Compressing | Op margin YoY change AND Net margin YoY change both below -50bps | Cost growth is outpacing revenue growth |
The 50 basis points threshold is meant to filter out reporting noise. Many companies record one-time charges that move margin by 20 to 30 basis points without changing the underlying operating story. A 50 basis point YoY move is large enough to be a real signal in most cases, but you can tighten or loosen it from the Inputs sheet.
The Margin Dashboard also conditional-formats the YoY columns with a green-yellow-red color scale so you can scan the watchlist visually before reading the tags.
The Triple Expander Filter
The Expansion Tracker sheet takes the YoY logic one level further. Instead of looking at just operating and net margin, it checks all three lines: gross, operating, and net. A name that expanded all three is tagged a "Triple Expander". A name that expanded two is a "Double Expander". One is "Single Expander". Zero is "Stable / Compressing".
| Status | Gross Margin YoY | Op Margin YoY | Net Margin YoY | Read |
|---|---|---|---|---|
| Triple Expander | + | + | + | Pricing, operating leverage, and bottom-line conversion all working |
| Double Expander | + or - mix | Two of three positive | One negative | Mixed story, look at the specific line |
| Single Expander | One of three positive | Two negative | Likely a one-off | Verify with the 10-Q before acting |
| Stable / Compressing | Zero positive | Margin story has broken | Avoid until the next print |
The Triple Expander tag is the strictest filter. Historically, names that print three expanding margin lines in the same quarter are a much smaller cohort than the broader "Expanding" tag on the Margin Dashboard. This is the filter to run when you want a short conviction list rather than a broad screen.
How To Use the Screener Sheet by Sheet
The workbook ships with eight sheets. Each one references the Inputs tab so changing one yellow cell ripples through the entire model.
Cover. Brands the workbook, shows the data-as-of date, and links back to MarketXLS for the live-formula version.
How To Use. A page-one explainer that walks a new user through every sheet without leaving Excel. Useful when you share the template with a colleague.
Inputs. All ten user inputs in one place. Portfolio size, max position cap, margin minimum thresholds, YoY expansion and compression thresholds, and the three composite score weights. Yellow background marks each editable cell.
Margin Dashboard. The main screener. One row per ticker with price, all four margin lines, the YoY change for op and net margin, ROE, P/E, the composite Margin Quality Score, and the Expanding / Stable / Compressing tag. Sort by score to rank the watchlist.
Expansion Tracker. Current quarter margin vs prior-year same-quarter margin for gross, operating, and net. Generates the Triple Expander / Double Expander / Single Expander / Stable filter. The template version of this sheet leaves the prior-year cells blank for you to fill from the 10-Q because MarketXLS does not currently expose a prior-year margin function directly.
Margin Trend. A clean side-by-side of all four margin lines plus the gross-to-operating gap. A wide gap means SG&A and R&D are absorbing a large share of revenue. A narrowing gap is the fingerprint of operating leverage. A widening gap is the fingerprint of cost creep.
Portfolio Allocation. Auto-sizes positions across the top eight names on the Margin Quality Score using your portfolio size and per-position cap. Computes cap shares, score-weighted dollar allocation, and final share counts. Shows total allocated, percent of portfolio, and cash reserve at the bottom.
Sector Comparison. Roll-up by GICS sector showing how many names in each sector tagged Expanding vs Stable vs Compressing. A sector with five Expanding names out of five is a stronger story than a sector with two Expanding names out of ten.
Building the Dashboard Formula by Formula
Here is the exact formula pattern that lives in row 4 of the Margin Dashboard for a single ticker. Adapt the references to your own watchlist.
Symbol: AAPL
Name: Apple Inc.
Sector: =Sector("AAPL")
Price: =QM_Last("AAPL")
Gross M %: =GrossMargin("AAPL")/100
Op M %: =OperatingMargin("AAPL")/100
EBIT M %: =EBITMargin("AAPL")/100
Net M %: =NetProfitMargin("AAPL")/100
ROE %: =ReturnOnEquity("AAPL")/100
P/E: =PERatio("AAPL")
MarketXLS returns margins as percentages (45.2 for 45.2%), so dividing by 100 in the cell gives you a clean decimal that pairs with Excel's "0.0%" number format. If you prefer to display the raw percentage, drop the divide and switch the format to "0.0".
The composite score formula in column M is longer because it embeds the sub-scores and the weights. Here is the pattern, with row references shown for row 4:
=(MIN(MAX(F4,0)/0.40,1)*50 + MIN(MAX(H4,0)/0.30,1)*50) * Inputs!$C$11
+ (((MIN(MAX(I4,-0.05)/0.05,1)*50+50)
+(MIN(MAX(J4,-0.05)/0.05,1)*50+50))/2) * Inputs!$C$12
+ MIN(MAX(K4,0)/0.30,1)*100 * Inputs!$C$13
Each MIN(MAX(...)) construct clamps a sub-score to a sensible band before applying the weight. F4 is operating margin, H4 is net margin, I4 is op margin YoY change, J4 is net margin YoY change, K4 is ROE. The Inputs references make the weights live, so changing them on the Inputs sheet updates every row in real time.
Sector Patterns in Q1 2026 Margins
Across the 28-name watchlist, the Q1 2026 sample data shows a clear sector split. Information Technology and Communication Services dominate the Triple Expander column. Energy and parts of Consumer Staples sit at the bottom. Industrials and Healthcare are mixed.
| Sector | Expanding (sample) | Compressing (sample) | Read |
|---|---|---|---|
| Information Technology | High | Low | AI capex monetization plus operating leverage in software |
| Communication Services | High | Low | Ad pricing recovery and cost discipline at platforms |
| Healthcare | Mixed | Mixed | Drug pricing held, but health insurance margins thinned |
| Industrials | Mixed | Mixed | Order book strength, but freight and labor cost pressure |
| Financials | Stable | Low | Net interest income held, payment networks expanded |
| Consumer Discretionary | Mixed | Mixed | Discounting cycle is uneven |
| Consumer Staples | Low | Mixed | Volume softness offset by mix richening |
| Energy | Low | High | Oil price normalization compressed refining and integrated margins |
| Materials | Mixed | Mixed | Industrial gases held, base metals softened |
These are sample-snapshot reads, not forecasts. The point of the live-formula template is that the picture changes every time a company reports. Refresh the workbook before every screen and the sector roll-up updates with it.
Implementation Tips From Live Use
A few field notes from running the screener on a weekly cadence.
First, refresh after every print, not just at quarter end. Q1 2026 stragglers reported through late May. NVIDIA reported May 28. Costco reports in early June. A screener built on TTM margins moves with every fresh 10-Q, so the order of names can change meaningfully week to week during the back half of a reporting season.
Second, do not trust a single Triple Expander quarter. Margin expansion is a noisy signal at the single-quarter level because of one-time items, restructuring charges, and accounting treatment of stock-based compensation. Look for at least two consecutive Triple Expander quarters before treating it as a durable signal. The Margin Trend sheet is structured to make multi-quarter inspection easier by sitting next to the Expansion Tracker.
Third, layer a valuation check on top. Margin expansion is a quality signal, not a valuation signal. Use the P/E column on the Margin Dashboard, or pull in =ForwardPE("AAPL") and =PEGRatio("AAPL") for a forward look. A Triple Expander at 60x earnings has a different risk profile than a Triple Expander at 18x.
Fourth, watch the gross-to-operating gap. The Margin Trend sheet flags this gap explicitly. A name that has expanding gross margins but flat or compressing operating margins is investing more in SG&A and R&D. That can be a growth story (rising sales force, more engineers) or a cost-control problem (sales productivity falling). The 10-Q breakdown tells you which.
Fifth, sanity-check the sector mix. If the dashboard top decile is entirely tech, the screener is doing what you set it up to do, but you may be missing structural changes elsewhere. The Inputs sheet weights are there so you can re-tilt the score toward absolute margin level (favors mature tech and financials) or toward expansion rate (favors mid-cycle industrials and recovering consumer names).
Download the Templates
Download the templates:
- - Pre-filled with snapshot data captured May 23, 2026. Every cell shows the MarketXLS formula that would power it in the live version.
- - Live-updating MarketXLS formulas. Requires a MarketXLS subscription.
Both files have the same eight-sheet structure. The sample version opens in plain Excel without any add-in and is useful for inspecting the formula structure before you commit to the live build. The template version is the one to use in a daily or weekly workflow because it pulls the most recent margin data automatically.
Pairing the Screener With MarketXLS Tools
The screener is more useful when you connect it to the rest of the MarketXLS workflow. A few pairings that show up often in live use:
- Stock screener. Use the MarketXLS stock screener to build a starting universe, then export the symbols into the Margin Dashboard for the margin overlay.
- AI stock screener. The AI stock screener layer can prefilter for "high quality" or "improving fundamentals" before you apply the margin gates.
- Stock analysis. Drop any Triple Expander name into the stock analysis tool for a deeper look at cash flow, balance sheet, and analyst estimates.
- Portfolio. Move the Portfolio Allocation sheet output into the portfolio tracker to monitor margin direction at the position level after entry.
The screener is the entry filter. The other tools cover what happens after.
FAQ
What is a margin expansion stock screener excel?
A margin expansion stock screener in Excel is a spreadsheet that ranks a universe of stocks by how much their gross, operating, and net margins have widened compared to the same quarter in the prior year. The MarketXLS version pulls live margin data with formulas like =GrossMargin(), =OperatingMargin(), and =NetProfitMargin() and combines them into a composite Margin Quality Score, then tags each name as Expanding, Stable, or Compressing.
How do I screen for margin expansion in Excel?
Build a watchlist of tickers, pull current and prior-year margin values for each, compute the year-over-year change, and rank the list by the change. With MarketXLS, the current values come from formulas like =OperatingMargin("AAPL") and =NetProfitMargin("AAPL"). The prior-year comparable can be pulled from the company's 10-Q or from MarketXLS Historical Financials. The Margin Expansion Stock Screener Excel template in this post does this for 28 large caps and updates live.
Which MarketXLS formula gives operating margin?
=OperatingMargin("AAPL") returns the trailing operating margin (operating income divided by revenue) for the ticker passed in. The result is a percentage value, so divide by 100 in the cell if you want a decimal that pairs with the "0.0%" Excel number format.
Is margin expansion a buy signal? Margin expansion is a quality signal, not a buy signal. It tells you the operating model is improving but says nothing about whether the price already reflects that improvement. Layer a valuation gate (P/E, forward P/E, PEG, or EV/EBITDA) on top of the screener before any decision. The Margin Dashboard in the template includes the P/E column for exactly this reason. This blog is educational and not investment advice.
Why use Excel instead of a screener website for margin screening? Three reasons. First, you control the universe (your own watchlist, your sector mix, your size cap). Second, you control the weighting (margin level vs expansion vs ROE) instead of accepting a vendor preset. Third, the result is auditable - every column is a formula you can inspect, and every formula is live with MarketXLS, so you are not waiting on a refresh cycle on a third-party site.
Can I add forward estimates to the margin expansion screener?
Yes. Add a column for =EPSEstimateAvgNextQuarter("AAPL") or =ForwardPE("AAPL") to bring forward-looking earnings into the dashboard. Forward margin is harder to source as a single function, but you can compute an implied forward operating margin by combining forward revenue estimates with consensus operating income estimates pulled via the EarningsEstimates family of MarketXLS formulas.
The Bottom Line
Margin expansion is the cleanest read on whether an operating model is working. Revenue growth can be bought. EPS growth can be financially engineered. Margins are the part that has to be earned in the income statement. A screener built around margin level, year-over-year change, and ROE quality lets you cut through the Q1 2026 earnings noise and focus on names where the operating story is intact.
The Margin Expansion Stock Screener Excel template gives you that screener in eight sheets, with every column powered by a verified MarketXLS formula. Download the sample to inspect the structure. Plug the template into your live workflow if you have a MarketXLS subscription. Visit marketxls.com for the full library of Excel-native financial data tools, or book a demo to see how the screener fits into a broader research workflow.
This template is for educational use only. Nothing here is a recommendation to buy or sell any security. Backtest any rule-based screener and verify the data before putting real money behind it.