Spreadsheet Functions

Function List

SheetsFinance provides 12 core functions across Market Data, Options, and Brokerage. Use the table below as a quick reference, then read each function’s signature and parameter list.

Function

Product

Purpose

SF()

Market Data

Real-time and historical data

SF_TIMESERIES()

Market Data

Historical price and volume timeseries

SF_DIVIDEND()

Market Data

Historical dividend records

SF_CALENDAR()

Market Data

Financial calendars and US Treasury rates

SF_SPARK()

Market Data

Sparkline helper for historical prices

SF_TECHNICAL()

Market Data

Technical indicators

SF_NEWS()

Market Data

News feeds

SF_SCREEN()

Market Data

Stock screening queries

SF_MAP()

Market Data

Map global identifiers to tickers

SF_OPTIONS()

Market Data

Delayed, simplified snapshot

SF_OPTIONS_PRO()

Options

Professional options analytics

SF_BROKERAGE()

Brokerage

Connected brokerage account data

Market Data

SF()

Most real-time and historical data is accessed through SF(). Its signature is:

=SF(symbol, type, subtype/metric, year, options)
  • symbol — Ticker symbol (e.g. "AAPL"). Use Symbol Search to find the correct code.

  • type — Data type category. Options include "realTime", "companyInfo", "income", "balancesheet", "cashflow", "historical", "ratios", "peers", "growth", "change", "estimates", "priceTargets", "analysts", "ratings", "instHolders", "etfInfo", "etfHoldings", "etfSectors".

  • subtype/metric — Data subcategory. See the specific data type’s documentation for the full list.

  • year — Year in YYYY form (e.g. "2010"). Used for financial statements, "growth", "historical", and "ratios". Can be a range (e.g. "2010-2020") or "ttm". For "priceTargets", this is treated as the last X months. Optional for "realTime", "companyInfo", "analysts", and "ratings".

  • options — Adjusts output formatting. Available options vary by data type; see that data type’s documentation.

If no type, subtype, or year is given, the function returns the real-time current price.

=SF("AAPL")
=SF("BTCUSD")
=SF("USDGBP")

See Realtime, Company Info, Key Ratios, Peers, Company Growth, Price Targets, Analyst Estimates, Analyst Ratings, Analyst Ratings Totals, Historical Financials, ETF Info, ETF Holdings, ETF Sectors, and Institutional Holders for detailed usage.

SF_TIMESERIES()

Historical stock or coin price and volume data. Returns multiple rows depending on the period specified. Its signature is:

=SF_TIMESERIES(symbol, startDate, endDate, period, metric, options)
  • symbol — Ticker symbol (e.g. "AAPL").

  • startDate — Starting date in YYYY-MM-DD format (e.g. "2000-04-03").

  • endDate — Ending date in YYYY-MM-DD format (e.g. "2019-12-24").

  • period — Intraday period (e.g. "5min"). Overrides startDate and endDate when used. Omit for a daily timeseries.

  • metric — Metric to display: "open", "high", "low", "close", "volume", "change", or "changePercent".

  • options"-" for descending order and "NH" for no header. Combine with "-&NH".

See Timeseries for detailed usage.

SF_DIVIDEND()

Historical company dividends. Returns multiple rows and columns depending on the date range and metrics requested. Its signature is:

=SF_DIVIDEND(symbol, startDate, endDate, metric, options)
  • symbol — Ticker symbol (e.g. "AAPL").

  • startDate — Start date in YYYY-MM-DD format.

  • endDate — End date in YYYY-MM-DD format.

  • metric — Metrics to display. Leave blank or use "all" for all metrics. Chain multiple metrics with & (e.g. "date&dividend"). Available metrics: "date", "dividend", "adjDividend", "recordDate", "paymentDate", "declarationDate".

  • options"-" for descending order and "NH" for no header. Combine with "-&NH".

See Dividends for detailed usage.

SF_CALENDAR()

Financial calendars and date-based financial data such as US Treasury Rates. Returns multiple rows and columns depending on the date range and metrics requested. Its signature is:

=SF_CALENDAR(searchTerms, type, startDate, endDate, metrics, options)
  • searchTerms — Terms to filter results. Chain multiple terms with &. Leave blank for no filtering.

  • type — Calendar type. Options: "earnings", "dividends", "splits", "economic", "treasury".

  • startDate — Start date in YYYY-MM-DD format. Maximum range between startDate and endDate is 90 days; larger ranges are truncated.

  • endDate — End date in YYYY-MM-DD format.

  • metrics — Metrics to display. Leave blank or use "all". Chain with &. Metrics are specific to the calendar type; see that type’s documentation.

  • options"-" for descending order and "NH" for no header. Combine with "-&NH".

See Calendar and US Treasury Rates for detailed usage.

SF_SPARK()

Historical stock or coin price data formatted for Sparklines. Use this inside Google Sheets’ built-in SPARKLINE() function. Its signature is:

=SF_SPARK(symbol, lastXdays, type)
  • symbol — Ticker symbol (e.g. "AAPL").

  • lastXdays — Number of days to display (e.g. "365" for the last year).

  • type"price" (or leave blank) for a price sparkline, or "volume" for a volume bar chart.

Nest this function inside Google Sheets’ SPARKLINE() like so: =SPARKLINE(SF_SPARK(...)).

SF_TECHNICAL()

Technical analysis over historical price data for a stock, crypto, or ETF. Its signature is:

=SF_TECHNICAL(symbol, type, period, startDate, endDate, options)
  • symbol — Ticker symbol (e.g. "AAPL").

  • type — Analysis type, chained with additional display items using & (e.g. "sma20&all", "ema50&date&close", "williams100&date&high&low"). Include the subperiod (e.g. sma20 for a 20-period Simple Moving Average).

  • period — Base period (e.g. "daily", "1min", "30min").

  • startDate — Starting date in YYYY-MM-DD format.

  • endDate — Ending date in YYYY-MM-DD format.

  • options — Set to "NH" for no header row. Not applicable for single-cell outputs.

See Technicals for detailed usage.

SF_NEWS()

News feeds for stocks, crypto, and FOREX/commodities. Its signature is:

=SF_NEWS(symbol(s), type, limit, metrics, site, startDate, endDate, options)
  • symbol(s) — Ticker symbol or range of cells for batch requests (e.g. A1:A10).

  • type — Feed type: "stocks", "crypto", or "forexAndCommodities". Defaults to "stocks".

  • limit — Number of articles to pull. Defaults to 10. Limits are plan-dependent; see the pricing page for details.

  • metrics — Metrics to display. Leave blank or use "all". Chain with & (e.g. "publishedDate&url").

  • site — [Optional] Filter by source site (e.g. "barrons.com"). Chain multiple sites with &.

  • startDate — [Optional] Starting date in YYYY-MM-DD format. Only applicable for "stocks".

  • endDate — [Optional] Ending date in YYYY-MM-DD format. Only applicable for "stocks".

  • options — [Optional] "NH" for no header and "-" for descending order. Chain with & (e.g. "NH&--").

See News for detailed usage.

SF_SCREEN()

Screen the entire financial asset database with a query string. Its signature is:

=SF_SCREEN(query_string, metrics, options)
  • query_string — Filter query (e.g. "marketcap>1000000000&exchange=NYSE,NASDAQ&sector=Technology").

  • metrics — Columns to return. Leave blank or use "all". Chain with & (e.g. "symbol&sector&industry&exchange&marketCap&price").

  • options — Output formatting. "NH" removes headers. "ob=<metric>" orders by a metric (e.g. "ob=beta"). See the Stock Screener documentation for the full list.

See Stock Screener for detailed usage.

SF_MAP()

Map global identifying codes to stock ticker symbols. Its signature is:

=SF_MAP(code, type)
  • code — Identifier to map (e.g. a CUSIP number).

  • type — Code type (e.g. "cusip" or "cik"). Defaults to CUSIP if omitted.

See ISIN, CUSIP & CIK Mapper for detailed usage.

Options

SF_OPTIONS()

Option chain data for a stock or specific contract. Its signature is:

=SF_OPTIONS(symbol, type, metric, expirationDate, options)
  • symbol — Stock ticker (e.g. "AAPL") or a fully specified options contract symbol (e.g. "AAPL240920C00160000"). Use Symbol Search to find codes.

  • type — Option type: "expirationDates", "calls", or "puts". Has no effect if a contract symbol is used.

  • metric — Metrics to display. Leave blank or use "all". Chain with & (e.g. "contractSymbol&strike"). Available metrics: "all", "contractSymbol", "strike", "value", "change", "percentChange", "volume", "openInterest", "bid", "ask", "mid", "expirDate", "impliedVolatility", "inTheMoney".

  • expirationDate — Expiration date in YYYY-MM-DD format. Defaults to the next valid expiration after the entered date if not exact. Has no effect if a contract symbol is used.

  • options"-" for descending order and "NH" for no header. Combine with "-NH".

See Options Basic and Options for detailed usage.

SF_OPTIONS_PRO()

Professional options analytics including full OPRA chains with Greeks, historical chain snapshots, IV term structure, surface data, earnings analytics, and IV rank data. Requires an active Options subscription. Its signature is:

=SF_OPTIONS_PRO(symbol, dataType, expirationDate, strike, tradeDate, endDate, metrics, options)
  • symbol — Underlying ticker (e.g. "AAPL"), a fully specified OCC contract symbol (e.g. "AAPL251219C00165000"), or a range of symbols for batched "ivRank" requests.

  • dataType — Analytics dataset: "calls", "puts", "calls&puts", "expirationDates", "ivPeriods", "surface", "surfaceForecast", "earnings", "ivRank". Entering "strikes" aliases to "calls&puts".

  • expirationDate — Target expiration date in YYYY-MM-DD format or as an Excel date serial.

  • strike — Used for contract-level lookups when not using a full OCC contract symbol. Leave blank for full chain outputs and non-contract data types.

  • tradeDate — Requests historical data when supplied. For "expirationDates", returns the expiration dates available on that historical date.

  • endDate — Used for historical "calls", "puts", "ivPeriods", and "ivRank" requests.

  • metrics — Metrics to display. Leave blank or use "all". Chain with &.

  • options — Additional request or output options. Chain with &.

See Options for detailed usage.

Brokerage

SF_BROKERAGE()

Real-time data from connected brokerage accounts. Only available to users who have connected their brokerage accounts via SheetsFinance. Its signature is:

=SF_BROKERAGE(account, type, metrics, startDate, endDate, txnType, options)
  • account — Nickname of the brokerage account connection. Find or set nicknames in the Brokerage Sidebar (Extensions > SheetsFinance > Brokerage). See Setting Nicknames for Your Brokerage Accounts for more information.

  • type — Data type:

  • metrics — Data to pull. Available metrics depend on the type. See Brokerage for details.

  • startDate — [Optional] Start date in YYYY-MM-DD format. Required only for "transactions".

  • endDate — [Optional] End date in YYYY-MM-DD format. Required only for "transactions".

  • txnType — [Optional] Transaction type filter. Required only for "transactions". Options: "BUY", "SELL", "DIVIDEND", "CONTRIBUTION", "WITHDRAWAL", "REI", "INTEREST", "FEE", "OPTIONEXPIRATION", "OPTIONASSIGNMENT", "OPTIONEXERCISE", "TRANSFER".

  • options — Output formatting. "NH" removes the header row. "ob=<metric>" orders by a specific metric (e.g. "ob=symbol"). "-" reverses the order. Combine options with & (e.g. "ob=symbol&-").

See Brokerage for detailed usage.

Was this helpful?