How to track your stock portfolio in a spreadsheet

A simple, durable layout for tracking positions, cost basis, gains and dividends from your brokerage export, with the formulas for each column.

By the Jordan team · · 3 min read

Your broker's app shows you a balance, a daily change and a list of holdings. It rarely answers the questions you actually have: how much of the portfolio sits in one company, what you've really made on a position you've traded in and out of, or how much dividend income arrived last quarter.

A spreadsheet answers all of those, and it keeps answering them as you add data. The trick is a layout where nothing is typed twice and every number is a formula over your own records.

The layout: three tabs

Tab What it holds Who writes it
Transactions One row per buy, sell, dividend or fee, as exported You (paste or import)
Prices One row per ticker: latest price and the date you took it You, or a data connection
Holdings One row per ticker: shares, cost, value, gain, weight Formulas only

The rule that makes it last: never edit the Holdings tab by hand. If a number there is wrong, the fix belongs in Transactions or Prices.

Transactions

Most brokers let you download account activity as CSV. Keep the columns you need and give them stable names:

Date Ticker Type Shares Amount
2026-02-03 AAPL Buy 10 -2,284.00
2026-03-14 AAPL Dividend 2.50
2026-05-20 AAPL Sell -4 921.60

Use a sign convention and stick to it: shares are positive for buys and negative for sells, and amounts are negative when cash leaves your account. Then totals work with a plain SUM.

Holdings

With the transactions in a table, each holding column is one formula. If the ticker is in A2:

  • Shares held: =SUMIFS(Transactions!D:D, Transactions!B:B, A2)
  • Net cash invested: =-SUMIFS(Transactions!E:E, Transactions!B:B, A2, Transactions!C:C, "Buy") - SUMIFS(Transactions!E:E, Transactions!B:B, A2, Transactions!C:C, "Sell")
  • Price: =XLOOKUP(A2, Prices!A:A, Prices!B:B)
  • Value: =B2 * D2 (shares times price)
  • Weight: =E2 / SUM(E:E)

Net cash invested is the simplest honest view of "what did I put in." Broker cost basis is usually reported per lot and adjusted for things like wash sales, so it can differ. For a position you have never sold, the two match.

Gains

Unrealized gain on a position you still hold is value minus cost basis. If you've sold part of a position, splitting gains into realized and unrealized needs a lot method (first in, first out is the common default). That is fiddly to do by hand and easy to get wrong, which is exactly the kind of work worth handing to an agent and then checking.

Keep one thing straight: a gain is not a return. Ten percent on a position you bought last month and ten percent on one you've held for five years are very different results. For returns over time, see time-weighted and money-weighted returns.

Dividends

Add a Month column to Transactions with =TEXT(A2, "yyyy-mm"), then a small table with months down the side:

=SUMIFS(Transactions!E:E, Transactions!C:C, "Dividend", Transactions!F:F, A2)

Each month's total comes straight from the rows, so when next quarter's export arrives, the table extends itself.

Keeping it current

Once a month, paste the new export below the old rows (or import it as a new file and append), and update the Prices tab. Everything else recomputes. If you keep the date next to each price, you'll always know how stale a valuation is.

Doing it with Jordan

In Jordan you connect Robinhood, which pulls your positions, quotes and price history for you, or import your broker's export. Then ask for what you want, for example: "Build a holdings tab from these transactions with shares, net invested, value, weight and sector, and a dividends-by-month table." Jordan writes the formulas above (adjusted to your broker's column names) and shows you the changes before they land. Check the row count against your export and recompute one holding by hand before accepting.

Frequently asked questions

Should I use average cost or FIFO?

For understanding a portfolio, either is fine as long as you use one consistently. For taxes, use what your broker reports on its tax forms, because that is what the IRS receives.

How do I handle stock splits?

A split changes the share count but not the money invested. Most broker exports include the split as its own row; make sure your Shares column picks it up so share counts and prices stay consistent.

Is this investment advice?

No. A tracker describes what you own and what happened. It doesn't say what to buy or sell.

Build this analysis in Jordan

Describe it in a sentence. Jordan brings in the data, writes the formulas and shows you every change before it lands.

Join early access

Keep reading