# Google Sheets, Excel & Notion Stock Market Templates: =QUANTSET(), DCF & 67-Country Portfolio Tracker

> Copy-paste the =QUANTSET() custom Google Sheets function, =IMPORTDATA() CSV templates, Excel Power Query scripts, and Notion AI MCP connector across 90,000+ global symbols, SEC 10-K/10-Q filings, and 4,899 ETFs.

Canonical URL: https://quantset.dev/docs/guides/google-sheets-excel-notion-stock-templates
Full LLM API Contract: https://api.quantset.dev/llms-full.txt

> ## For AI agents
> The QuantSet API is at https://api.quantset.dev. Send the key in the `X-API-Key` header. The sandbox key `mw_demo` needs no signup and reads the sample listings.
> No key yet? An agent can open an account on its own: https://api.quantset.dev/skill.md
> Connect an MCP client to https://api.quantset.dev/mcp. Client setup is at https://api.quantset.dev/agents.md.
> Start with https://api.quantset.dev/llms.txt or read the full reference at https://api.quantset.dev/llms-full.txt. The OpenAPI file is https://api.quantset.dev/openapi.json. Add `.md` to any docs URL to get that page as Markdown.

Put **90,000+ global symbols across 67 countries**, **36,000+ companies with standardized financial statements**, **127M+ SEC EDGAR XBRL facts**, and **4,899 ETF look-through holdings** directly inside Google Sheets, Excel, and Notion—without `=GOOGLEFINANCE()` `#N/A` timeouts or paid add-in bloat.
          

          

## 1. The =QUANTSET() Custom Google Sheets Function (30-Second Copy-Paste)

          

Instead of pasting long URLs into every cell or exposing your API key in shared formulas, paste this 30-line script into **Extensions → Apps Script** once. It adds a native `=QUANTSET(dataset, tickers, params)` formula to your workbook that reads your API key from a single config cell (`Config!B1`) or Script Properties and defaults to the free `mw_demo` sandbox key automatically:
          
            
```
/**
 * Query QuantSet live market data, SEC 10-K/10-Q statements, 4,899 ETFs & 40-factor screens.
 *
 * Examples:
 *   =QUANTSET("quotes", "us:NVDA,us:AAPL,global:SHEL.L,global:1301.T,crypto:BTCUSDT")
 *   =QUANTSET("income", "us:NVDA", "period=annual&limit_per_instrument=5")
 *   =QUANTSET("cash-flow", "us:NVDA", "period=quarterly&limit_per_instrument=8")
 *   =QUANTSET("etf-holdings", "us:IVV", "limit=25")
 *   =QUANTSET("screener", "", "min_roic=20&max_pe_ttm=25&limit=25")
 *
 * @param {string} dataset Dataset slug ("quotes", "prices", "income", "balance-sheet", "cash-flow", "etf-holdings", "screener", "dividends", "treasury-yields").
 * @param {string} tickers Optional ticker or comma-separated tickers ("NVDA" or "us:NVDA,global:SHEL.L").
 * @param {string} extraQuery Optional query string ("period=quarterly&limit_per_instrument=4").
 * @return {Array>} 2D table of headers and rows.
 * @customfunction
 */
function QUANTSET(dataset, tickers, extraQuery) {
  var routes = {
    "quotes": "/api/v1/quotes",
    "prices": "/api/v1/prices",
    "snapshots": "/api/v1/snapshots",
    "income": "/api/v1/financial-statements/income",
    "balance-sheet": "/api/v1/financial-statements/balance_sheet",
    "cash-flow": "/api/v1/financial-statements/cash_flow",
    "etf-holdings": "/api/v1/etf-holdings",
    "etf-exposures": "/api/v1/etf-exposures",
    "screener": "/api/v1/screener",
    "dividends": "/api/v1/dividends",
    "estimates": "/api/v1/estimates",
    "insider-activity": "/api/v1/insider-activity",
    "institutional-ownership": "/api/v1/institutional-ownership",
    "treasury-yields": "/api/v1/macro/treasury-yields",
    "fx-rates": "/api/v1/fx/rates"
  };
  var path = routes[dataset] || ("/api/v1/" + dataset.replace(/^\/+/, ""));
  var key = PropertiesService.getScriptProperties().getProperty("QUANTSET_API_KEY") || "mw_demo";
  try {
    var cfg = SpreadsheetApp.getActiveSpreadsheet().getRange("Config!B1").getValue();
    if (cfg && String(cfg).trim()) key = String(cfg).trim();
  } catch (e) {}

  var params = ["format=csv"];
  if (tickers && String(tickers).trim()) {
    var t = String(tickers).trim();
    var paramName = (path.indexOf("/quotes") !== -1 || path.indexOf("/financial-statements/") !== -1 || path.indexOf("/fundamentals") !== -1) ? "tickers" : "ticker";
    params.push(paramName + "=" + encodeURIComponent(t));
  }
  if (extraQuery && String(extraQuery).trim()) params.push(String(extraQuery).trim().replace(/^[?&]+/, ""));

  var url = "https://api.quantset.dev" + path + "?" + params.join("&");
  var res = UrlFetchApp.fetch(url, { headers: { "X-API-Key": key }, muteHttpExceptions: true });
  if (res.getResponseCode() !== 200) {
    return [["QuantSet HTTP " + res.getResponseCode(), res.getContentText().slice(0, 240)]];
  }
  return Utilities.parseCsv(res.getContentText());
}
```

          
          

**How to upgrade from sample tickers to all 90,000+ symbols:** Create a tab named `Config` and paste your personal `qsk_...` key into cell `B1` (get **250 free credits** with no credit card at [quantset.dev/signup](https://quantset.dev/signup)). Every `=QUANTSET()` formula in your workbook unlocks the full 67-country catalog immediately.

          

## 2. Four Ready-to-Copy Google Sheets Model Formulas (=IMPORTDATA() & =QUANTSET())

          

Don't want to open Apps Script? Every QuantSet GET endpoint works natively with Google Sheets' built-in `=IMPORTDATA()` formula. Paste any of these four templates into cell `A1` of a blank sheet:

          

### Template A: Global Multi-Currency Portfolio & Crypto Watchlist (67 Countries in 1 Formula)

          

Pull live prices, 1-day change, market cap, P/E, and local currency across New York (`us:NVDA`, `us:AAPL`), London (`global:SHEL.L`), Tokyo (`global:1301.T`), India (`global:RELIANCE.NS`), and Crypto (`crypto:BTCUSDT`) in a single cell—zero `#N/A` timeouts:
          
            
```
=IMPORTDATA("https://api.quantset.dev/api/v1/quotes?tickers=us:NVDA,us:AAPL,us:MSFT,global:SHEL.L,global:1301.T,global:RELIANCE.NS,crypto:BTCUSDT&format=csv&apikey=mw_demo")
```

          

          

### Template B: 5-Year SEC 10-K & Discrete 10-Q DCF Valuation Model

          

Populate an automated Discounted Cash Flow (DCF) workbook with reconciled SEC EDGAR income statements, balance sheets, discrete quarterly cash flows (never cumulative YTD traps), and live 1M–30Y U.S. Treasury WACC yields:
          
            
```
=IMPORTDATA("https://api.quantset.dev/api/v1/financial-statements/income?tickers=us:NVDA&period=annual&limit_per_instrument=5&format=csv&apikey=mw_demo")
```

          
          
            
```
=IMPORTDATA("https://api.quantset.dev/api/v1/financial-statements/cash_flow?tickers=us:NVDA&period=quarterly&limit_per_instrument=8&format=csv&apikey=mw_demo")
```

          
          
            
```
=IMPORTDATA("https://api.quantset.dev/api/v1/financial-statements/balance_sheet?tickers=us:NVDA&period=quarterly&limit_per_instrument=4&format=csv&apikey=mw_demo")
```

          

          

### Template C: ETF Look-Through Holdings & Reverse Stock-to-ETF Exposure (4,899 Funds)

          

Unpack any ETF's constituent weights from SEC Form N-PORT filings—or flip it around and list every ETF holding a specific stock ordered by portfolio weight:
          
            
```
=IMPORTDATA("https://api.quantset.dev/api/v1/etf-holdings?ticker=us:IVV&limit=50&format=csv&apikey=mw_demo")
```

          
          
            
```
=IMPORTDATA("https://api.quantset.dev/api/v1/etf-exposures?ticker=us:NVDA&limit=25&format=csv&apikey=mw_demo")
```

          

          

### Template D: 40-Factor Quality Compounder & Net-Buyback Stock Screener

          

Screen 52,000+ US and international stocks directly into a sheet by ROIC, EV/FCF, EV/EBITDA, revenue growth, and 1-year share-count reduction ("buyback cannibals"):
          
            
```
=IMPORTDATA("https://api.quantset.dev/api/v1/screener?min_roic=20&max_pe_ttm=30&max_share_count_change_1y=-1&limit=25&format=csv&apikey=YOUR_API_KEY")
```

          

          

## 3. Excel Power Query Templates (Windows & Mac — Zero Add-In Required)

          

Excel's built-in **Power Query** engine refreshes live CSV tables into structured Excel Tables (`Ctrl+Alt+F5` to refresh all tabs) while keeping your `X-API-Key` inside the HTTP header instead of cell formulas. In Excel, click **Data → Get Data → From Other Sources → Blank Query → Advanced Editor** and paste this parameterized query:
          
            
```
let
    ApiKey = "mw_demo",
    Ticker = "us:NVDA",
    Source = Csv.Document(
        Web.Contents("https://api.quantset.dev", [
            RelativePath = "api/v1/financial-statements/income",
            Query = [
                tickers = Ticker,
                period = "annual",
                limit_per_instrument = "10",
                format = "csv"
            ],
            Headers = [#"X-API-Key" = ApiKey]
        ]),
        [Delimiter = ",", Encoding = 65001, QuoteStyle = QuoteStyle.Csv]
    ),
    PromotedHeaders = Table.PromoteHeaders(Source, [PromoteAllScalars = true])
in
    PromotedHeaders
```

          

          

## 4. Notion Investment Trackers, Research Wikis & Notion AI / Make / n8n

          

Running your investment committee, deal pipeline, or portfolio tracker in **Notion**? Here are the three fastest ways to wire live QuantSet fundamentals, SEC filings, and 67-country prices into Notion databases:
          
            
- **Claude + Notion MCP Bridge (Zero Code):** Connect QuantSet MCP (`https://api.quantset.dev/mcp`) alongside the official Notion MCP server in Claude Desktop, Claude Code, or Cursor. Ask: *"Run a 5-year DCF and 7-point forensic audit on NVDA using QuantSet, and save the valuation summary and peer table into my Notion Investment Memos database."*
            
- **Google Sheets → Notion Embed:** Drop any of the four Google Sheets templates above into a sheet, click **File → Share → Publish to web**, and paste the link into a Notion `/embed` block for a live-updating portfolio or peer multiples table inside your Notion page.
            
- **Automated Notion Database Sync (n8n / Make / Pipedream):** Schedule an HTTP GET node to `https://api.quantset.dev/api/v1/quotes?tickers=us:NVDA,us:AAPL,global:SHEL.L` with header `X-API-Key: qsk_...` every market close to update price, P/E, EV/FCF, and next earnings date properties on your Notion Stocks database.
          

          

## Why Teams Move Off GOOGLEFINANCE(), STOCKHISTORY() & Paid Add-Ins

          
            
              
                
| Capability | `=GOOGLEFINANCE()` / Excel `STOCKHISTORY()` | Paid Add-Ins ($50–$150/mo) | QuantSet CSV & `=QUANTSET()` |
              
              
                
| **Global coverage** | Frequent `#N/A` on London, Tokyo, India & ETFs | Mostly US-only or expensive add-on tiers | **90,000+ symbols across 67 countries + 734 crypto pairs** |
                
| **SEC 10-K / 10-Q statements** | None (price & basic P/E only) | Often mixes YTD cash flows into quarters | **36,000+ companies + 127M+ SEC XBRL facts (discrete quarters)** |
                
| **ETF look-through holdings** | None | Rare / top 10 holdings only | **4,899 ETFs (`175,000+` Form N-PORT rows) + reverse stock-to-ETF exposure** |
                
| **Batch 100 tickers in 1 call** | No (1 volatile formula per cell/metric) | Throttled per cell | **1 formula returns 100 tickers × all columns** |
                
| **Works across Sheets, Excel, Notion & AI** | Locked to one spreadsheet app | Locked to one browser plugin | **Same key works in Sheets, Excel, Notion, Python, TypeScript & Claude/Cursor MCP** |
                
| **Free to start** | Yes (limited) | Credit card wall | **`mw_demo` (0 signup) + 250 free credits on signup** |

---

## QuantSet Ecosystem & Integrations (https://quantset.dev/integrations)

- **MCP Clients & 7 Skills:** `npx quantset init` & `npx skills add quantset/skills` (Claude, Claude Code, Cursor, ChatGPT, Codex, Hermes, OpenClaw, Block Goose, Cline, Docker MCP Toolkit — `https://api.quantset.dev/mcp`)
- **Python SDK & Agent Frameworks:** `pip install "quantset[pandas]"` · `from quantset.tools import build_agent_functions, langchain_tools, crewai_tools` (PydanticAI, LangGraph, LangChain, CrewAI, Agno, AutoGen, Google ADK, OpenAI Agents SDK)
- **TypeScript SDK & Vercel AI / Mastra:** `npm install quantset` · `import { createQuantsetTools } from "quantset/tools"` (Node 20+, Bun, Deno, Cloudflare Workers, Vercel Edge)
- **Spreadsheets & Workspaces:** Google Sheets (`=QUANTSET()` & `=IMPORTDATA()`), Microsoft Excel Power Query (`?format=csv`), Notion MCP & n8n/Make webhooks (`https://quantset.dev/docs/guides/google-sheets-excel-notion-stock-templates`)
- **Drop-In Migrations & Machine Payments:** FMP `/stable/*` & `/v3/*` adapter (`https://quantset.dev/docs/switch/fmp`), `yfinance` migration (`https://quantset.dev/docs/switch/yfinance`), autonomous signup (`https://api.quantset.dev/skill.md`), and `x402` Base USDC.
