# Build a Dividend & Buyback Portfolio Tracker in Sheets

Why GOOGLEFINANCE() returns #N/A on stock dividend yields, and how to pull ex-dividend dates, payout streaks, and net share buyback yields into Sheets.

Open Google Sheets right now, type `=GOOGLEFINANCE("AAPL", "yieldpct")` or `=GOOGLEFINANCE("MSFT", "dividend")` into a cell, and hit Enter. Instead of Apple's or Microsoft's dividend yield, Google Sheets returns a blunt `#N/A` error: *Attribute 'yieldpct' is invalid for the given ticker.*

That single quirk surprises almost every income investor who migrates a dividend portfolio into Google Sheets. Despite what dozens of outdated blog posts claim, **`=GOOGLEFINANCE()` only supports `dividend` and `yieldpct` on mutual funds—never on individual common stocks, REITs, BDCs, ADRs, or international equities.**

Even worse, when investors try to work around that limitation by scraping dividend websites with `=IMPORTHTML()` or `=IMPORTXML()`, two things break immediately:
1. **Cloudflare and Bot-Blocking (`HTTP 403` / `#N/A`):** Dividend directories and retail portals aggressively block Google's shared `GoogleDocs` proxy IP ranges, turning your income calendar into a wall of `#N/A` errors right before ex-dividend week.
2. **Ignoring the Other Half of Shareholder Return (Share Buybacks vs. Dilution):** In modern equity markets, S&P 500 companies return more cash through **share repurchases** than cash dividends—yet plenty of "high-dividend" traps fund their payout by issuing new shares orStock-Based Compensation (`SBC`), quietly diluting your ownership slice every year.

In this guide, we will build an **automated Total Shareholder Yield (Dividends + Net Buybacks) Portfolio Tracker in Google Sheets and Microsoft Excel** powered by **QuantSet's corporate-actions and SEC XBRL warehouse** (`90,000+` symbols across `67` countries, verified cash dividend histories, split records, and SEC-audited share counts). Every formula below runs immediately on sample tickers (`us:NVDA`, `us:AAPL`, `us:MSFT`, `us:IVV`, `global:SHEL.L`) with zero signup via `mw_demo`, and unlocks your entire portfolio when you drop a free personal key (`250 free credits` on signup, no credit card) into cell `Config!B1`.

---

## Why Every "Free Google Sheets Dividend Workaround" Fails in Practice

Before wiring a permanent data feed, look at why the three common "free" spreadsheet tricks inevitably corrupt an income tracker:

| Common Workaround | What Happens After Two Weeks | Hidden Portfolio Risk |
| --- | --- | --- |
| **`=GOOGLEFINANCE(A2, "yieldpct")`** | Returns `#N/A` on 100% of individual stocks, REITs, and international listings | Forces manual data entry on every stock holding |
| **`=IMPORTXML("https://finviz.com/...", "//td")`** | Fails randomly with `Could not fetch url` whenever Google's proxy IP hits a rate limit or HTML layout changes | Breaks ex-dividend dates, special dividends, and foreign ADR currency units |
| **Static Trailing Annual Dividend Manual Cells** | Never updates after dividend hikes, cuts, stock splits, or special distributions | Misses dividend cuts until cash fails to hit your brokerage account, and ignores share dilution |

To track income like an institutional equity desk, your workbook needs **four primary-source tables** from one consistent API:
1. **Verified Historical Cash Dividends (`/api/v1/dividends`):** Exact ex-dividend date, payment date, record date, declaration date, frequency, and split-adjusted cash amount per share.
2. **Live Valuation & Yield Snapshots (`/api/v1/snapshots` & `/api/v1/quotes`):** Current share price, trailing dividend yield, payout ratio (`Dividends Paid / Free Cash Flow`), and native currency (`USD`, `GBp`, `JPY`, `CAD`, `EUR`, `AUD`).
3. **Net Buyback / Dilution Audit (`/api/v1/shares-outstanding` & `/api/v1/financial-statements/cash_flow`):** Trailing 1-year and 3-year diluted share-count change (`%`) plus cash spent on share repurchases minus Stock-Based Compensation (`SBC`).
4. **Dividend-Reinvested Total Return (`/api/v1/total-return`):** True cumulative return assuming dividends were reinvested on each ex-dividend date, compared directly against raw price return and the S&P 500 (`index:SPX`).

---

## Step 1: Set Up Your `Config` Tab & `=QUANTSET()` Function

Create a tab named **`Config`** in your Google Sheet:
- Cell **`B1`**: `mw_demo` *(replace with your `qsk_...` key from [quantset.dev/signup](/signup) when you add your own tickers)*
- Cell **`B2`**: `us:AAPL,us:MSFT,us:NVDA,us:IVV,global:SHEL.L` *(your comma-separated portfolio tickers)*

If you haven't added our 30-line `=QUANTSET()` custom function yet, open **Extensions → Apps Script**, paste the `QUANTSET()` snippet from our [Google Sheets, Excel & Notion Templates Playbook](/docs/guides/google-sheets-excel-notion-stock-templates), and hit Save. (Prefer zero scripts? Every example below also shows the exact built-in `=IMPORTDATA()` formula!)

---

## Step 2: Pull Verified Ex-Dividend Dates & Payout History (`/api/v1/dividends`)

Create a tab named **`Dividend_Ledger`** and paste this formula into cell **`A1`**:

```excel
=IMPORTDATA("{{public_base}}/api/v1/dividends?ticker=us:AAPL&limit=24&format=csv&apikey="&Config!B1)
```

*(Or with the custom function: `=QUANTSET("dividends", "us:AAPL", "limit=24")`.)*

### What Appears in Your Sheet Immediately

QuantSet populates up to 24 historical dividend distributions with:
- **`ex_date`**: The exact ex-dividend cutoff date (the date you must own shares before market open to receive the payout).
- **`payment_date`** & **`record_date`**: When the cash actually lands in your brokerage account—essential for building a **12-Month Forward Cash-Flow Calendar** by month (`SUMIFS` grouped by `MONTH(payment_date)`).
- **`amount`**: Cash distribution per share in the listing's native currency (`currency`).
- **Split-Cross-Checked Continuity:** Have you ever looked at a stock that executed a `4-for-1` or `10-for-1` forward split (like Apple in 2020 or NVIDIA in 2024) and seen a cheap dividend tracker claim the company "cut its dividend by 75%–90%"? QuantSet cross-checks historical dividends against verified split factors (`/api/v1/splits`) so historical dividend growth rates (`3Y` and `5Y` Dividend CAGR) are never corrupted by stock splits.

### Formula to Calculate 5-Year Dividend CAGR & Consecutive Hike Check

Once `Dividend_Ledger` is loaded, compute annual dividends per share for the latest full calendar year vs. five years prior using `SUMIFS`:

```excel
=LET(
  yr_now, YEAR(TODAY()) - 1,
  yr_5y, yr_now - 5,
  div_now, SUMIFS(Dividend_Ledger!D:D, Dividend_Ledger!C:C, ">="&DATE(yr_now,1,1), Dividend_Ledger!C:C, "<="&DATE(yr_now,12,31)),
  div_5y, SUMIFS(Dividend_Ledger!D:D, Dividend_Ledger!C:C, ">="&DATE(yr_5y,1,1), Dividend_Ledger!C:C, "<="&DATE(yr_5y,12,31)),
  IF(AND(div_now > 0, div_5y > 0), POWER(div_now / div_5y, 1/5) - 1, "N/A")
)
```

---

## Step 3: Measure FCF Payout Safety (Catching Yield Traps Before a Dividend Cut)

The biggest mistake retail dividend investors make is judging dividend safety using **GAAP Earnings Payout Ratio (`Dividends / Net Income`)**.

GAAP Net Income is an accrual accounting figure. A capital-intensive telecom, utility, pipeline, or industrial company can report positive GAAP EPS while spending 110% of its Operating Cash Flow on maintenance CapEx—meaning it is **borrowing debt or issuing shares just to pay its dividend!**

To audit true cash dividend coverage in Google Sheets or Excel, pull the company's trailing four quarters of **discrete quarterly cash flows** into a `Cash_Coverage` tab:

```excel
=IMPORTDATA("{{public_base}}/api/v1/financial-statements/cash_flow?tickers=us:AAPL,us:MSFT&period=quarterly&limit_per_instrument=4&format=csv&apikey="&Config!B1)
```

From `operating_cash_flow`, `capital_expenditure`, `dividends_paid`, and `common_stock_repurchased`, compute **True Free Cash Flow Dividend Coverage**:

1. **Trailing 12-Month Free Cash Flow (`FCF`):**
   $$\text{FCF}_{\text{TTM}} = \sum_{q=1}^{4} \left(\text{Operating Cash Flow}_q - |\text{CapEx}_q|\right)$$
2. **Cash FCF Payout Ratio (`%`):**
   $$\text{FCF Payout Ratio} = \frac{\sum_{q=1}^{4} |\text{Common Dividends Paid}_q|}{\text{FCF}_{\text{TTM}}}$$

| Cash FCF Payout Ratio | Dividend Safety Grade | Institutional Interpretation |
| --- | --- | --- |
| **`< 40%` of FCF** | **Fortress (`A+`)** | Massive headroom for double-digit annual dividend hikes + opportunistic buybacks |
| **`40% – 70%` of FCF** | **Healthy Core (`B+`)** | Sustainable mature compounder target zone (unless highly cyclical) |
| **`70% – 95%` of FCF** | **Tight / Watch (`C`)** | Vulnerable in a recession or interest-rate refinancing cycle; check `/api/v1/debt-maturities` |
| **`> 100%` of FCF (or Negative FCF)** | **Yield Trap (`RED FLAG`)** | Dividend is funded by new debt, asset sales, or equity dilution—high cut risk |

---

## Step 4: Add Net Buyback Yield ("Total Shareholder Yield") & Screen for Cannibals

Focusing solely on cash dividend yield blinds you to the highest-returning capital allocators in the market—companies like Apple, AutoZone, Meta, Visa, or Japanese/European industrial compounders that retire **3% to 7% of their outstanding shares every year**.

Conversely, a stock paying a `4.5%` dividend yield while expanding its diluted share count by `+5.0%` per year (via secondary offerings or heavy executive RSU grants) actually has a **negative `-0.5%` net equity yield**!

### Pulling SEC-Verified Share Count Shrinkage (`/api/v1/shares-outstanding`)

Drop this formula into your `Share_Count` tab to inspect point-in-time cover-page share counts directly from SEC Form 10-K and 10-Q DEI disclosures:

```excel
=IMPORTDATA("{{public_base}}/api/v1/shares-outstanding?ticker=us:AAPL&limit=12&format=csv&apikey="&Config!B1)
```

Even better, when you hold a personal QuantSet key in `Config!B1`, you can **screen all 52,000+ US and international stocks in one spreadsheet formula** to find **Dividend + Buyback "Share Cannibals"** (high ROIC, sustainable P/E, positive dividend yield, and shrinking share count):

```excel
=IMPORTDATA("{{public_base}}/api/v1/screener?min_dividend_yield=1.5&max_share_count_change_1y=-2&min_roic=18&max_pe_ttm=25&limit=30&format=csv&apikey="&Config!B1)
```

Look at what that single formula filters across the warehouse:
- **`min_dividend_yield=1.5`**: Pays at least a 1.5% cash dividend today.
- **`max_share_count_change_1y=-2`**: Retired **at least 2.0% net of its diluted shares** over the past 12 months (after accounting for all employee stock-based compensation dilution!).
- **`min_roic=18` & `max_pe_ttm=25`**: Earns $>18\%$ Return on Invested Capital and trades below $25\times$ earnings.

---

## Step 5: True Dividend-Reinvested (`DRIP`) Total Return vs. S&P 500

If you compare a high-dividend stock or international value stock (like `global:SHEL.L` or `us:IVV`) against a zero-dividend tech stock using raw `close` prices, you systematically understate the dividend payer's compounding by 30% to 150% over a decade.

QuantSet computes evidence-verified **Dividend-Reinvested Total Return** (`/api/v1/total-return`) and **Benchmark-Relative Alpha** (`/api/v1/benchmark-relative-returns`) server-side, cross-checking every split and cash dividend against primary price continuity:

```excel
=IMPORTDATA("{{public_base}}/api/v1/total-return?ticker=us:AAPL&start=2020-01-01&format=csv&apikey="&Config!B1)
```

### Loading the Complete Income & Buyback Dashboard in Excel (Power Query)

Prefer **Microsoft Excel**? Open **Data → Get Data → From Other Sources → Blank Query → Advanced Editor** and paste this Power Query loader to pull your batch watchlist quotes, dividend history, or cannibal screener straight into a refreshable Excel Table (`Ctrl+Alt+F5`):

```powerquery
let
    ApiKey = "mw_demo",
    Source = Csv.Document(
        Web.Contents("{{public_base}}", [
            RelativePath = "api/v1/dividends",
            Query = [
                ticker = "us:AAPL",
                limit = "20",
                format = "csv"
            ],
            Headers = [#"X-API-Key" = ApiKey]
        ]),
        [Delimiter = ",", Encoding = 65001, QuoteStyle = QuoteStyle.Csv]
    ),
    PromotedHeaders = Table.PromoteHeaders(Source, [PromoteAllScalars = true])
in
    PromotedHeaders
```

---

## Frequently Asked Questions

### Why does `=GOOGLEFINANCE("SCHD", "yieldpct")` or `=GOOGLEFINANCE("O", "yieldpct")` return `#N/A`?
Google Finance restricts the `yieldpct` and `dividend` attributes exclusively to open-end mutual funds (like `VTSAX`). ETFs (`SCHD`, `VYM`, `IVV`), REITs (`O`, `VICI`), and common stocks (`AAPL`, `JNJ`, `SHEL.L`) all return `#N/A`. Querying QuantSet's `/api/v1/dividends`, `/api/v1/etf-profile`, and `/api/v1/snapshots` endpoints returns verified dividend yields and distribution schedules across stocks, REITs, and **4,899 ETFs**.

### Does QuantSet track international dividends across UK, Canadian, European, and Asian stocks?
Yes. QuantSet covers **90,000+ symbols across 67 countries**, preserving the exact local currency (`GBp`, `GBP`, `CAD`, `EUR`, `CHF`, `JPY`, `AUD`, `HKD`, `INR`) alongside 42 reference FX cross-rates (`/api/v1/fx/rates`) so multi-currency income investors can project dividend income in their home currency accurately.

### How can I audit my entire dividend portfolio in 15 seconds using Claude or Cursor?
Install QuantSet's open-source skill pack (`npx skills add quantset/skills` and `npx quantset init`) and ask: *"Run `portfolio-xray` and `forensic-red-flags` on my dividend portfolio (`AAPL, MSFT, SHEL.L, IVV`)—check FCF payout ratios, 1-year net share dilution, ETF overlap, and 24-month debt walls."* See our [Adjusted Close, Splits & Dividends Playbook](/docs/guides/adjusted-close-splits-api) and [Google Sheets, Excel & Notion Templates guide](/docs/guides/google-sheets-excel-notion-stock-templates) for more formulas.
