Back to the blog

Spreadsheets

Investment Tracker Spreadsheet: Log Holdings, Dividends and Returns (Free Template)

Track contributions, holdings, dividends and fees in one sheet. Our free .xlsx template calculates units held, net invested, total return and allocation vs. your own target, with a worked example, CAGR and XIRR explained.

Despezzas TeamPublished on Nov 28, 2026 at 9:14 AM · 16 min read
Computer monitor showing a green and red candlestick price chart, with blurred city lights in the background
Computer monitor showing a green and red candlestick price chart, with blurred city lights in the background

Updated on November 28, 2026. Sources checked on Nov 28, 2026: Microsoft Support: XIRR function, Microsoft Support: Get a stock quote, Google Docs Editors Help: GOOGLEFINANCE, Investor.gov (U.S. SEC): How Fees and Expenses Affect Your Investment Portfolio

A broker's dashboard shows a balance. A tracker answers the questions behind it, across every account: how much did I put in, how much came back as income, what did fees cost, and is my mix still where I want it?

This guide is about tracking, not picking investments. Nothing here is a recommendation to buy or sell anything.

What an investment tracker spreadsheet should track (and why)

Data pointWhy it matters
Every transaction (date, account, asset, type, quantity, price)Everything else is calculated from it. If the log is right, the totals are right.
Deposits and withdrawalsYour return has to be measured against the money you put in, not against the account balance.
Dividends and interestLeave them out and you understate returns, especially for bond funds and dividend-paying stocks.
FeesThey come straight off your return. See the fees section below.
Current price per holdingTurns units into market value.
Asset classShows your allocation, so you can compare it with your own target.

One thing comes first: investing usually comes after a cash cushion. If you don't have one yet, see how big your emergency fund should be. Paying down high-interest debt before investing is common too, and the debt tracker spreadsheet works the same way as this template.

What's inside the free investment tracker template

Yellow cells are for you to type in. Blue cells are formulas. There is no currency symbol, so use one currency throughout the workbook. Nothing is locked or protected. The file ships with 8 hypothetical sample transactions for two made-up holdings, SAMPLE-STOCK and SAMPLE-BOND, and sample target percentages. Every sample cell is labelled "Hypothetical sample - delete me" (Transactions rows 5–12, Holdings rows 5–6, the Allocation targets). Select those yellow cells and press Delete. Clear the contents only; don't delete the rows.

TabWhat it doesWhat you type
InstructionsStep-by-step setup, how every formula works, a monthly routineNothing
TransactionsOne row per event, 200 rowsDate (mm/dd/yyyy), Account, Ticker or name, Asset class, Type, Quantity, Price (or cash amount), Notes
HoldingsOne row per holding, 30 rows, plus a totals rowTicker or name, Current price
AllocationValue by asset class vs. your targetTarget % per class
SummaryTotals and simple total returnNothing (all formulas)
ListsFeeds the drop-downsYour account names (up to 10)

The drop-downs in Transactions:

  • Account: Brokerage, Retirement, Other. Rename them or add your own (up to 10) in the yellow cells on the Lists tab.
  • Asset class: Stocks, Bonds, Cash, Real estate, Other.
  • Type: Buy, Sell, Dividend, Interest, Fee, Deposit, Withdrawal.

Amount is a formula. For Buy and Sell it's Quantity × Price. For Dividend, Interest, Fee, Deposit and Withdrawal, leave Quantity empty and type the cash amount in the Price column; Amount then equals that number. Always type positive numbers. The Type tells the formulas which way the money moved.

How to set up your investment tracker spreadsheet, step by step

  1. Download the template and open it in Excel or LibreOffice. For Google Sheets, upload it with File > Import. If you're new to Sheets, our Google Sheets budget spreadsheet guide covers the basics.
  2. Name your accounts on the Lists tab and clear the sample rows (the worked example below uses them, so you may want to study them first).
  3. Log your starting point. If you're starting with investments you already own, the simplest way in is one Deposit row for the money behind them, then one Buy row per holding with the units and the average price from your broker's cost-basis page.
  4. Log every new event from then on: deposits, buys, sells, dividends, interest and fees. For a reinvested dividend, log the Dividend row and then a Buy row for the units it bought.
  5. Use the exact same ticker or name every time. The Holdings tab matches on that text, so "ABC" and "abc fund" count as two different holdings.
  6. Fill in Holdings: type each ticker once, exactly as in Transactions, plus its current price. Asset class is copied from the first matching transaction.
  7. Type your own target mix on the Allocation tab. The targets should add up to 100%; the total row tells you if they don't.
  8. Review once a month: update prices, check Units held against your statement, and check Uninvested cash against the cash balance your broker shows.

The formulas, explained

All formulas use SUMIFS, SUMIF, INDEX/MATCH and IFERROR, with no XLOOKUP, dynamic arrays or LAMBDA, so they work in older Excel versions, LibreOffice and Google Sheets.

Column (Holdings tab)Formula logic
Units heldUnits bought − units sold (two SUMIFS on Transactions, by ticker and type)
Net invested (cost basis)Buy amounts − Sell amounts + Fees tagged with that ticker
Market valueUnits held × Current price
Unrealized gainMarket value − Net invested
Gain %Unrealized gain ÷ Net invested
Dividends/interest receivedDividend + Interest amounts for that ticker
Total return %(Market value + Dividends/interest − Net invested) ÷ Net invested

Gain % and Total return % stay blank when Net invested is zero or negative, which can happen after you've sold more than you put in, so you never see #DIV/0!.

A note on "cost basis". Net invested is the net cash you've put into a holding. After a partial sale it is not the cost basis tax authorities use, which depends on methods like average cost or specific lots. Whatever country you live in, keep your broker's cost-basis records and trade confirmations for tax time; the spreadsheet doesn't replace them.

On the Summary tab:

  • Uninvested cash = Deposits − Withdrawals − Buys + Sells + Dividends + Interest − Fees. If it's negative, you've probably missed a Deposit.
  • Total value = market value of holdings + uninvested cash.
  • Gain/loss = Total value + Withdrawn − Contributed.
  • Simple total return = Gain/loss ÷ Total contributed.

On the Allocation tab, each class's value is a SUMIF over Holdings. Cash also includes the uninvested cash (when positive). Current % = value ÷ total. Difference = Current % − Target %. Amount to rebalance = Target % × Total − Value.

Worked example (illustrative, hypothetical numbers)

These are the sample rows that come with the template, rounded for clarity. All figures were checked with Python and with LibreOffice's own recalculation.

DateTypeHoldingQty × PriceAmount
01/05/2026Deposit——10,000
01/06/2026BuySAMPLE-STOCK50 × 1206,000
01/06/2026FeeSAMPLE-STOCK—5
01/06/2026BuySAMPLE-BOND30 × 1003,000
06/15/2026DividendSAMPLE-STOCK—60
07/01/2026InterestSAMPLE-BOND—90
09/10/2026SellSAMPLE-STOCK10 × 1301,300
11/02/2026Withdrawal——500

With current prices of 135 (stock) and 98 (bond), the Holdings tab shows:

HoldingUnitsNet investedMarket valueUnrealized gainGain %IncomeTotal return %
SAMPLE-STOCK404,7055,40069514.77%6016.05%
SAMPLE-BOND303,0002,940−60−2.00%901.00%
  • Stock net invested: 6,000 + 5 − 1,300 = 4,705. Total return: (5,400 + 60 − 4,705) ÷ 4,705 = 16.05%.
  • Bond: the price fell (−2.00%), but with 90 of interest the total return is (2,940 + 90 − 3,000) ÷ 3,000 = +1.00%. This is why income belongs in the tracker.
  • Uninvested cash: 10,000 − 500 − 9,000 + 1,300 + 60 + 90 − 5 = 1,945.
  • Total value: 5,400 + 2,940 + 1,945 = 10,285. Gain: 10,285 + 500 − 10,000 = 785. Simple total return: 7.85%.

The Allocation tab, compared with the template's hypothetical 60/30/10 target (an example, not a suggestion):

ClassValueCurrent %Target %DifferenceAmount to rebalance
Stocks5,40052.50%60%−7.50 pts+771.00
Bonds2,94028.59%30%−1.41 pts+145.50
Cash1,94518.91%10%+8.91 pts−916.50

Simple return vs. annualized return (CAGR) vs. XIRR

The simple total return (7.85% above) says how much you've gained in total. It doesn't say over how long, and it ignores when money went in or out. The Summary tab says this in a note: it is not a time-weighted or money-weighted return, and it isn't annualized.

To compare periods of different lengths, use the compound annual growth rate (CAGR):

CAGR = (Ending value ÷ Starting value)^(1 ÷ years) − 1

Illustrative example: 10,000 that grows to 14,000 in 4 years, with no money added or taken out, has a simple return of 40%. Its CAGR is (14,000 ÷ 10,000)^(1/4) − 1 = 8.78% a year. In Excel or Sheets: =(14000/10000)^(1/4)-1. To see why returns build on themselves, read our compound interest guide.

CAGR only works when nothing is added or withdrawn along the way. Most real portfolios get regular contributions, so the result depends on timing: money added last month has had almost no time to grow. A money-weighted return accounts for that, and the spreadsheet tool for it is XIRR.

Optional advanced step: XIRR. Microsoft describes XIRR as returning "the internal rate of return for a schedule of cash flows that is not necessarily periodic." The syntax is XIRR(values, dates, [guess]), the values must include at least one positive and one negative number, and later payments are discounted on a 365-day year (Microsoft Support: XIRR function, accessed Nov 28, 2026). To use it in Excel:

  1. In an empty area, list each deposit as a negative number and each withdrawal as a positive number, with its date.
  2. Add a last row with today's total value as a positive number and today's date.
  3. Use =XIRR(amounts, dates).

With the sample data (−10,000 on 01/05/2026, +500 on 11/02/2026, +10,285 on 11/28/2026), XIRR comes to about 8.84% a year. It's higher than the 7.85% simple return because the money was invested for 327 days, less than a full year. The template leaves XIRR out on purpose: it only works on a clean list of cash flows, and it returns #NUM! when the signs or dates are wrong.

How to get current prices into the sheet

Typing prices by hand works anywhere and takes a minute a month. If you want them filled in automatically:

Google Sheets: GOOGLEFINANCE (Sheets only; it doesn't exist in Excel or LibreOffice). Put =GOOGLEFINANCE("EXCHANGE:TICKER","price") in the Current price cell, with your own exchange code and ticker in place of the placeholder. Google's help page says it's "mandatory to use both the exchange symbol and ticker symbol". It also says quotes "may be delayed up to 20 minutes", are "not sourced from all markets", and that the function "does not support most international exchanges". Mutual fund attributes "are currently not supported", and the data is "not for trading purposes or advice" (Google Docs Editors Help: GOOGLEFINANCE, accessed Nov 28, 2026). For anything it can't price, type the price yourself.

Excel: Stocks data type. Type a ticker, company or fund name in a cell, go to Data > Stocks, then use the Add Column button to pull in a field such as Price. Microsoft says the Stocks data type is "only available to Microsoft 365 accounts or those with a free Microsoft Account", lists Excel for Microsoft 365 (Windows and Mac) and Excel for the web, and requires an editing language such as English or Spanish. It also says stock information "is delayed, provided 'as-is', and is not for trading purposes or advice" (Microsoft Support: Get a stock quote, accessed Nov 28, 2026). Put the linked price in a helper column and point Current price at it.

Rebalancing check: comparing with your own target

The Allocation tab doesn't tell you what your mix should be. That depends on your goals, time horizon and risk tolerance, and it's your decision (or one you make with a professional). What the tab does is show drift: how far each class has moved from your own target, and roughly how much money would bring it back. In the example, cash has grown to 18.91% against a 10% target, mostly because of the sale.

Two practical notes:

  • The "Amount to rebalance" column ignores trading fees and any taxes on selling. Many people bring their mix back toward target by directing new contributions to the class that's under target, rather than selling.
  • The tab combines all your accounts. If you have one account you never touch, it still counts toward your mix.

Fees: the cost your investment tracker spreadsheet should show

The U.S. SEC's investor education site says that "fees and expenses reduce the amount of money in your investment portfolio earning a return". Its example: a hypothetical $100,000 investment growing 4% a year for 20 years ends at about $208,000 with a 0.25% annual fee, about $198,000 with 0.50%, and about $179,000 with 1.00%. The bulletin also explains that fees "typically come in two types—transaction fees and ongoing fees", and lists account statements, trade confirmations and fund prospectuses as places to find them (Investor.gov: How Fees and Expenses Affect Your Investment Portfolio, July 23, 2025 bulletin, accessed Nov 28, 2026).

In the template:

  • Log transaction fees (commissions, for example) as a Fee row with the ticker. They're added to that holding's net invested and lower its return.
  • Log account fees as a Fee row without a ticker. They lower uninvested cash and the overall return.
  • Ongoing fund expenses are listed in the fund prospectus fee table, as the SEC bulletin notes. If they don't appear as a separate charge on your statement, write each fund's expense ratio in the Notes column so it stays visible.

Investment tracker spreadsheet vs. an app

Spreadsheet (this template)Portfolio app or broker dashboard
CostFreeVaries
Covers several brokers/accountsYes, you log them allDepends on the app and your country
Control over formulasFullNone
PricesManual, or GOOGLEFINANCE / Stocks data typeUsually automatic
EffortAbout 10 minutes a monthLow once connected
PrivacyThe file stays with youData shared with the provider

A spreadsheet suits a handful of holdings and people who want to see every number; a dedicated tool suits frequent traders or dozens of positions.

Where Despezzas fits (and where it doesn't)

Despezzas is an AI expense and budget tracker, not a brokerage or portfolio tracker, and it doesn't track holdings or investment returns. What it helps with is the step that comes first: knowing where your money goes, so there's something left to invest each month. Automatic bank sync works only with Brazilian banks through Open Finance, and the app's currency is Brazilian reais (BRL). Outside Brazil, you log expenses manually, set budgets, limits and goals, and use AI categorization. If you haven't built a budget yet, start with how to make a budget. You can see the plans on the pricing page or create a free Despezzas account.

Frequently asked questions

Is this investment tracker spreadsheet free, and does it work in Google Sheets?

Yes. The .xlsx template is free and uses only standard functions (SUMIFS, SUMIF, INDEX/MATCH, IFERROR), so it works in Excel, LibreOffice Calc and Google Sheets once uploaded. Nothing is protected, so you can change any formula.

How do I record dividends that are reinvested?

Use two rows: a Dividend row for the cash amount, then a Buy row for the units bought with it. The dividend counts as income, and the units and net invested go up with the purchase.

Why is my "Uninvested cash" negative?

The sheet works out cash from your log: Deposits − Withdrawals − Buys + Sells + Dividends + Interest − Fees. A negative figure almost always means you logged buys without the Deposit that paid for them. Add a Deposit row with the right amount and date.

What's the difference between unrealized gain and total return?

Unrealized gain is only the change in market value against what you've put in (Market value − Net invested). Total return also adds the dividends and interest you've received. In the example, the bond fund shows −2.00% unrealized but +1.00% total return.

Can I track several accounts or brokers in one sheet?

Yes. Pick the account on each Transactions row; Holdings, Allocation and Summary combine all accounts, so the same fund held in two accounts appears as one Holdings row.

Does the sheet calculate my annual return?

No. It shows a simple total return. Use CAGR when no money moved in or out, and XIRR when it did (both explained above).

Can I use it for crypto, property or a savings account?

You can log anything with a quantity and a price. Use the "Other" or "Real estate" asset class, and update the price by hand. For a savings account or CD, a single "Cash" holding with a price of 1 and Interest rows works well.

Related

  1. Net Worth Tracker Spreadsheet: Calculate and Track Your Net Worth (Free Template)Spreadsheets
  2. Debt Tracker Spreadsheet: Free Template to List Every Debt, Pick a Payoff Order and Track ProgressSpreadsheets
  3. Bill Tracker Spreadsheet: Free Template to List Every Bill, Due Date and AutopaySpreadsheets
  4. Monthly Budget Template: Free Planner With Categories (Excel, Sheets, PDF)Spreadsheets