Formula Patterns

Build a market-cap index with the Stock Screener

Use the Stock Screener or =SF_SCREEN() to build a ranked list of the largest companies in a market by market cap and limit it to a fixed number of results. This creates a close approximation of popular indices like the ASX 300, even though the exact constituent list and rebalancing rules of official indices are not replicated.

Plan requirement: Basic filters such as market cap, exchange, and country are available on all plans from Investor up. Advanced financial metrics (98+ TTM ratios) require the Analyst plan or a commercial plan.

Build an ASX 300 approximation

Return the top 300 Australian stocks by market cap, ordered from largest to smallest.

  1. Open the Stock Screener from the Google Sheets dropdown, below the Function Generator. For the full UI walkthrough, see the Stock Screener guide.

  2. Add a country filter and set it to AU.

  3. Add an exchange filter and set it to ASX.

  4. Add a market cap filter with a minimum value such as 0 to include all actively trading ASX equities.

  5. In the metrics section, select symbol, marketCap, sector, and price so they appear in the output.

  6. Set the order to ob=marketCap so the largest companies appear first.

  7. Set the limit to 300 so the screen returns only the top 300 rows.

  8. Click Generate to insert the formula into the active cell.

The resulting formula looks like this:

=SF_SCREEN("country=AU&exchange=ASX&marketCap>0", "symbol&marketCap&sector&price", "ob=marketCap&limit=300")

Why this is an approximation

Official indices like the ASX 300 are maintained by index providers with specific eligibility rules, liquidity thresholds, and periodic rebalancing dates. The screen above returns the largest 300 companies by market cap on the ASX at the time the formula runs. It is a useful proxy for index construction and portfolio benchmarking, but it will not match the exact official constituent list.

Add advanced metrics

On the Analyst plan or a commercial plan, you can layer advanced TTM filters into the same screen to narrow the list further. For example, return only the top 300 ASX stocks with a Return on Equity TTM above 10%:

=SF_SCREEN("country=AU&exchange=ASX&marketCap>0&returnOnEquityTTM>0.10", "symbol&marketCap&sector&returnOnEquityTTM", "ob=marketCap&limit=300")

Other common advanced filters to pair with market-cap screens include:

  • Debt to Equity TTM: debtToEquityRatioTTM<0.50

  • Operating Profit Margin TTM: operatingProfitMarginTTM>0.15

  • Price to Earnings TTM: priceToEarningsRatioTTM<20

Limit and format the output

Use options to keep the result manageable:

  • limit=300 caps the output to the first 300 rows.

  • NH removes the header rows so you can feed the result directly into a chart or another function.

  • ob=-marketCap orders by market cap ascending instead of descending.

Options are chained with &:

=SF_SCREEN("country=AU&exchange=ASX&marketCap>0", "symbol&marketCap&sector", "ob=marketCap&limit=300&NH")

Swap the market or index size

The same pattern works for any market. Replace the country and exchange values with your target market, and change the limit to match the index size you want to approximate:

  • S&P 500 proxy: country=US&exchange=NYSE,NASDAQ with limit=500

  • TSX 60 proxy: country=CA&exchange=TSX with limit=60

  • NZX 50 proxy: country=NZ&exchange=NZX with limit=50

For the complete list of available filters, metrics, and options, see the Stock Screener function reference. For a parallel example that screens by sector and financial metrics, see Screen stocks by sector and financial metrics.

Was this helpful?