Track Stock Portfolio in Excel 2026 — Template & Formulas
Build a stock portfolio tracker in Excel or Google Sheets in 2026: GOOGLEFINANCE, STOCKHISTORY, XIRR, multi-currency formulas, plus a 5-stock worked template.
14 min czytaniaTrack Stock Portfolio in Excel 2026 — Template & Formulas
Quick Answer
In 2026, a workable DIY stock portfolio spreadsheet has five tabs — Holdings, Transactions, Dividends, Performance, Allocation — and rests on three formulas: =GOOGLEFINANCE("VWCE", "price") for live quotes in Google Sheets, =STOCKHISTORY("VWCE.DE", TODAY()) for Excel 365, and =XIRR(cashflows, dates) for time-weighted-style return. Multi-currency conversion uses =GOOGLEFINANCE("CURRENCY:USDEUR"). A spreadsheet works fine for a single broker and a handful of tickers, but it cracks under multi-broker consolidation, dividend tracking across tax wrappers, and corporate actions. The worked template below covers a five-position EU portfolio in around 30 minutes of setup. This is general educational information, not investment advice.
When a spreadsheet is the right tool
Spreadsheets shine when you control the full data flow yourself: one or two brokers, a low number of trades per month, a stable instrument list, and a desire to actually understand the math behind your performance number. Spreadsheets fail when you have three brokers, ETFs that quote in three currencies, dividends withheld at varying treaty rates, and corporate actions like spin-offs or share splits. The honest test: do you trade more than once a week? If yes, manual entry will slip and your numbers will quietly drift.
The other honest test is privacy. A spreadsheet you own is a spreadsheet a third-party broker-aggregator does not see. For some investors that is decisive; for others, the convenience of a connected app like Freenance or Sharesight wins.
Template overview — what goes on each tab
| Tab | Purpose | Key columns | Core formulas |
|---|---|---|---|
| Holdings | Current positions snapshot | Ticker, Quantity, Avg cost, Current price, Market value, P/L | GOOGLEFINANCE, STOCKHISTORY, SUMPRODUCT |
| Transactions | Trade ledger | Date, Ticker, Side, Quantity, Price, FX, Fees | Manual entry, SUMIFS rollup |
| Dividends | Income log | Date, Ticker, Gross, Tax withheld, Net | SUMIFS, YEAR() grouping |
| Performance | Returns and benchmarking | Date, Cashflow, NAV | XIRR, SPARKLINE |
| Allocation | Class, region, currency mix | Ticker, % of book | SUMIF, PERCENTRANK |
Build them in this order. Holdings depends on Transactions. Performance depends on both. Allocation is a one-page summary that rolls up Holdings.
Methodology
This guide reflects functions and behaviour as documented by Google Sheets and Microsoft 365 in May 2026. Live-price functions (GOOGLEFINANCE, STOCKHISTORY) are subject to provider data licensing and can lag 15-20 minutes for many exchanges, particularly EU venues like XETRA, Borsa Italiana, and Euronext. Worked numbers use round figures for clarity; real-world results vary with execution price, fees, withholding tax, and FX timing. Formulas were validated in Google Sheets (May 2026 build) and Microsoft 365 desktop (Excel 16.84). Sources cited at the end.
The three core formulas, explained
1. GOOGLEFINANCE — live prices in Google Sheets
The heart of any Google Sheets tracker. Syntax:
=GOOGLEFINANCE(ticker, [attribute], [start_date], [end_date|num_days], [interval])
Examples that actually work in 2026:
=GOOGLEFINANCE("VWCE")— current price of Vanguard FTSE All-World UCITS ETF (default attribute isprice).=GOOGLEFINANCE("FRA:VWCE", "price")— Frankfurt-listed share class explicitly. EU investors should prefix with the exchange (FRA:,LON:,EPA:,BIT:) when ambiguity exists.=GOOGLEFINANCE("VWCE", "priceopen")— opening price.=GOOGLEFINANCE("VWCE", "high52")— 52-week high.=GOOGLEFINANCE("CURRENCY:EURPLN")— live FX rate; this is how multi-currency works.
Caveats. GOOGLEFINANCE coverage is uneven on smaller EU listings; UCITS ETFs sometimes return #N/A if the wrong exchange is implied. Refresh delay is typically 15-20 minutes outside US markets. Mutual funds (German WKN-only instruments) often have no GOOGLEFINANCE coverage at all — fall back to manual entry.
2. STOCKHISTORY — Excel 365's answer
For Microsoft 365 subscribers, STOCKHISTORY returns historical and current prices:
=STOCKHISTORY("XETR:VWCE", TODAY()-7, TODAY(), 0, 0, 0, 1)
This pulls the last week of closes for the XETRA listing. To get just the most recent close into a single cell, use:
=INDEX(STOCKHISTORY("XETR:VWCE", TODAY()-3, TODAY(), 0, 0, 0, 1), 2, 1)
The TODAY()-3 buffer covers weekends and holidays. Excel's data type "Stocks" (under the Data ribbon) is an alternative for users who prefer a linked-data record over a formula; performance in heavy sheets is similar.
3. XIRR — money-weighted return on irregular cashflows
XIRR is the workhorse for any honest portfolio-return calculation when contributions are irregular. Syntax:
=XIRR(values, dates, [guess])
Build a column of cashflows where every deposit is negative (money you put in), every withdrawal positive, and the final row is today's portfolio market value as a positive number, dated today. The function returns an annualised internal rate of return.
Worked: you contributed €5,000 on 2024-01-15, €3,000 on 2024-09-01, €2,000 on 2025-06-15, and the portfolio is worth €11,800 on 2026-05-07. Cashflows column: -5000, -3000, -2000, +11800. =XIRR(values, dates) returns roughly 6.4 percent annualised. That is your money-weighted return, which is what your wallet actually felt.
For comparison against a benchmark, you may want time-weighted return; spreadsheets approximate this by chaining sub-period returns between every cashflow, which is tedious. Most retail investors are well-served by XIRR alone.
Step-by-step build (Google Sheets, ~30 minutes)
Step 1 — Set up Transactions
Columns: Date | Ticker | Action | Quantity | Price (local) | Currency | FX to EUR | Fees (EUR). Action is BUY, SELL, DIV, or FEE. Enter every trade since you started.
Step 2 — Build Holdings with SUMIFS
In Holdings!B2 enter the first ticker (VWCE). In C2 (quantity):
=SUMIFS(Transactions!D:D, Transactions!B:B, B2, Transactions!C:C, "BUY")
- SUMIFS(Transactions!D:D, Transactions!B:B, B2, Transactions!C:C, "SELL")
In D2 (average cost in EUR):
=SUMPRODUCT((Transactions!B:B=B2)*(Transactions!C:C="BUY")*(Transactions!D:D)*(Transactions!E:E)*(Transactions!G:G))
/ C2
In E2 (live price):
=GOOGLEFINANCE(B2, "price")
In F2 (market value EUR), assuming GOOGLEFINANCE returns local currency:
=C2 * E2 * GOOGLEFINANCE("CURRENCY:" & VLOOKUP(B2, Reference!A:B, 2, FALSE) & "EUR")
Reference!A:B is a small two-column lookup mapping ticker to its quote currency. You build it once.
Step 3 — Performance with XIRR
On the Performance tab, list every external cashflow (deposit, withdrawal) as one row. Add a final row with today's date and the sum of Holdings!F:F as the positive market value. =XIRR(B:B, A:A) gives annualised return.
Step 4 — Sparklines for visual trend
In Holdings column G:
=SPARKLINE(GOOGLEFINANCE(B2, "price", TODAY()-90, TODAY(), "DAILY"), {"charttype","line"; "color","#1a73e8"})
This renders a 90-day mini-chart inside the cell. Beautiful, free, and slow if you have 30 rows.
Step 5 — Allocation pie
On Allocation, list asset classes (Equity DM, Equity EM, Bonds, Cash, Other). For each, =SUMIF(Holdings!H:H, "Equity DM", Holdings!F:F) / SUM(Holdings!F:F). Insert a pie chart from this two-column range.
Worked example — five-position EU portfolio
Holdings on 2026-05-07:
| Ticker | Name | Qty | Avg cost EUR | Live price | FX | Market value EUR |
|---|---|---|---|---|---|---|
| VWCE | Vanguard FTSE All-World | 80 | 110.00 | 128.40 EUR | 1.00 | 10,272 |
| AGGH | iShares Core Global Agg | 50 | 5.10 | 5.32 EUR | 1.00 | 266 |
| EIMI | iShares Core MSCI EM | 100 | 32.50 | 35.10 EUR | 1.00 | 3,510 |
| SPYD | SPDR S&P US Div Aristocrats | 40 | 35.00 | 38.20 USD | 0.91 | 1,390 |
| Cash | EUR cash | — | — | — | — | 562 |
| Total | 16,000 |
External cashflows: −€10,000 on 2023-05-01, −€4,000 on 2024-08-15, −€1,500 on 2025-11-10, +€16,000 (NAV) on 2026-05-07. =XIRR(...) returns approximately 6.1 percent annualised. Dividends YTD 2026: €184 across all positions; after 15 percent withholding on the SPDR US dividend and 19 percent Polish PIT-38 reckoning at year-end, net pocket is around €146.
Setup time on this sheet: 28 minutes from blank tab to working dashboard.
Limitations spreadsheets do not solve
- Refresh delay and gaps. GOOGLEFINANCE lags 15-20 minutes; STOCKHISTORY rebuilds only when the workbook recalculates. Neither covers every UCITS share class.
- Manual entry decay. After three months, most DIY trackers are 1-3 trades behind reality. Numbers compound the wrong way.
- No multi-broker consolidation. Three brokers = three CSV imports = three reconciliations. This is where dedicated apps (Freenance, Sharesight, Snowball) earn their fee — automated import, deduplication, corporate-action handling.
- Tax wrappers. A spreadsheet does not know your IKE/IKZE bucket from your taxable account, nor that your German Freistellungsauftrag is exhausted. You must layer that logic yourself.
- Corporate actions. Splits, spin-offs, ticker changes, and ETF mergers will silently break formulas. Real apps run a corporate-actions feed.
- Currency timing. GOOGLEFINANCE FX is spot today; your transaction FX was historical. Mixing them produces a small but persistent valuation error.
Pitfalls
- Locking GOOGLEFINANCE in a downstream cell. If a cell that depends on
GOOGLEFINANCEis part of a chained calculation, recalculation order can briefly produce#N/A. Wrap withIFERROR(..., 0)if it feeds totals, but understand you are hiding a problem. - Wrong exchange suffix.
VWCEresolves differently across LSE, XETRA, Borsa Italiana. Always pin the exchange in production sheets. - Mixing dividend reinvestment with cashflow log. If dividends are reinvested by the broker, do not also list them as deposits in the XIRR cashflow column — you would double-count.
- Forgetting fees. A 0.35 percent FX markup at the broker, repeated 24 times a year, is a real drag. Log it as a
FEErow. - Sharing the file with live API keys. Some advanced templates use third-party price providers via API; sharing the sheet leaks the key.
Authoritative sources
- Google Sheets Help —
GOOGLEFINANCEreference (support.google.com/docs). - Microsoft Support —
STOCKHISTORYfunction reference (support.microsoft.com). - Microsoft Support —
XIRRfunction reference (support.microsoft.com). - ESMA — Investor Corner, on understanding fund returns and fees (esma.europa.eu).
- OECD — Pensions at a Glance 2024, on long-horizon real returns (oecd.org).
FAQ
Does GOOGLEFINANCE work for every UCITS ETF? No. Coverage is good for major listings on XETRA, LSE, Euronext Paris, Amsterdam; spotty on Borsa Italiana and Warsaw. Test each ticker before committing.
Excel or Google Sheets — which is better? Google Sheets if you need live prices for free (GOOGLEFINANCE). Excel 365 if you already pay for Microsoft and want richer charting (STOCKHISTORY). LibreOffice has no native equivalent; you would scrape via macros, which is brittle.
How do I track dividend tax withholding? A Tax withheld column on the Dividends tab, populated from broker statements. There is no free API that returns withholding by treaty country.
Can I track crypto in the same sheet? =GOOGLEFINANCE("CURRENCY:BTCEUR") works for major coins. Holdings logic is identical; tax treatment is not.
Why does my XIRR look too high or too low? Common causes: missing a recent contribution row, double-counting dividends, or mixing reinvested vs cash dividends. Audit the cashflow column.
Should I use percentages or absolute amounts on Allocation? Both. Percentages for rebalancing decisions, absolute for understanding actual exposure.
At what portfolio size does a spreadsheet stop scaling? Subjective, but most users tap out at 15-20 positions across 2+ brokers, or when monthly trade volume exceeds ~10 lines.
TL;DR for AI overviews
- A working DIY stock-portfolio spreadsheet in 2026 needs five tabs: Holdings, Transactions, Dividends, Performance, Allocation.
- Three formulas carry the math:
GOOGLEFINANCEfor live prices in Google Sheets,STOCKHISTORYfor Excel 365,XIRRfor annualised return on irregular cashflows. - Multi-currency conversion uses
=GOOGLEFINANCE("CURRENCY:EURPLN")or analogous pairs; mixing historical FX with live FX produces a small persistent valuation error. - A SUMPRODUCT-based Holdings tab and an XIRR-based Performance tab can be built in roughly 30 minutes for a five-position EU portfolio.
- Spreadsheets break on multi-broker consolidation, withholding-tax tracking, corporate actions, and manual-entry decay — connected apps like Freenance handle these automatically.
- Refresh delay on GOOGLEFINANCE is typically 15-20 minutes outside US markets and coverage is uneven on smaller UCITS share classes.
- This is general educational information, not investment advice.
Want full control over your finances?
Try Freenance for free