How to track a stock and dividend portfolio in Excel

This is not investment, tax, or legal advice. The sheet is a record of trades and prices you type. It is not a quote, not a forecast, and not a tax-lot report.

Alex Rivera keeps one taxable brokerage account. The prices below are the sample prices typed on December 15, 2026. The file does not download them.

The workbook is the stock and dividend portfolio tracker.

The four symbols

Northwind Foods (NWFD): buy 40 shares at $50.00 on January 15. Price on December 15 is $54.00. The shares are worth $2,160.00. Cost is still $2,000.00. Unrealized gain is $160.00.

Harbor Electric (HBEL): buy 25 shares at $80.00 on February 2. Price is $78.00. Market value is $1,950.00. Unrealized loss is $50.00.

Maple Software (MPLE): buy 20 shares at $100.00 on March 2. Sell 8 shares at $130.00 on September 1. Twelve shares remain. Average cost is $100.00, so the remaining cost is $1,200.00. At $125.00 the market value is $1,500.00. Unrealized gain is $300.00. The sale cleared $1,040.00 against $800.00 of cost, so the realized gain is $240.00. Maple paid no dividend, so yield on cost is 0.00%.

River Bank (RVBN): buy 30 shares at $40.00 on May 4. Sell all 30 at $44.00 on November 16. Market value is zero. Realized gain is $120.00. There is no yield on cost, because no cost remains.

Open shares together are worth $5,610.00. Cost of those shares is $5,200.00. Unrealized gain is $410.00. Realized gain is $360.00.

Dividends

Northwind paid $0.40, $0.40, $0.42, and $0.42 per share on the 40 shares: $16.00, $16.00, $16.80, and $16.80. That is $65.60.

Harbor paid $0.60 three times on 25 shares: $15.00, $15.00, and $15.00. That is $45.00.

River Bank paid $0.25 once on 30 shares: $7.50.

The year is $118.10. By month: March $16.00, April $15.00, June $23.50, July $15.00, September $16.80, October $15.00, December $16.80. June is both the Northwind payment and the River Bank payment. January, February, May, August, and November are zero.

Yield on cost here is the dividends in the 12 months ending on the as-of date, divided by the cost of shares still held.

SUMIFS
=B2/B3
=B2/B3B4
Northwind yield on cost
AB
1Value
2Dividends65.60
3Cost basis2000
4Yield on cost3.28%
A picture of Northwind Foods. $65.60 of dividends divided by the $2,000.00 still invested is 3.28%.
=65.60/2000

Northwind is 3.28%. Harbor is $45.00 / $2,000.00 = 2.25%. The same total, by symbol and by month, is a SUMIFS on the journal.

The dated return is 16.5252%

Cash put in is $2,000.00 + $2,000.00 + $2,000.00 + $1,200.00 = $7,200.00. Cash that came back is the two sales, $1,040.00 and $1,320.00, plus $118.10 of dividends, which is $2,478.10. Add the $5,610.00 of stock still held and ending wealth is $8,088.10. Total gain is $888.10.

XIRR uses the actual dates. Buys are negative. Sales and dividends are positive. The last amount is the market value on December 15, as if the open shares were sold that day. It is not a sale in the journal. Two amounts fall on December 15: the $16.80 dividend and the $5,610.00 market value.

XIRR
=XIRR(B2:B16,A2:A16)
=XIRR(B2:B16,A2:A16)B17
Dated cash
AB
1DateCash
201/15/2026-2000
302/02/2026-2000
403/02/2026-2000
503/15/202616
604/01/202615
705/04/2026-1200
806/15/202616
906/30/20267.50
1007/01/202615
1109/01/20261040
1209/15/202616.80
1310/01/202615
1411/16/20261320
1512/15/202616.80
1612/15/20265610
17XIRR16.5252%
A picture of the return. Buys are negative. The last row is the $5,610.00 market value on 12/15/2026, not a sale. Four decimals show 16.5252%.
=XIRR(B2:B16,A2:A16)

The full rate is about 16.5252016% a year. A four-decimal percent format shows 16.5252%. Store the dates as real date serials. A text date that the locale reads backwards moves the rate.

This is not the sample on How to calculate an investment return with XIRR. That page invests $10,000 on January 15, 2026 and receives $2,500, $4,000, and $5,000 later. Its rate is about 17.7486%. Do not paste these portfolio rows into that grid.

CAGR is 13.5540%, and it ignores the dates

xl.cagr is (end / start) ^ (1 / years) - 1. RRI does the same job and has since Excel 2013. This file uses POWER so it opens in Excel 2010.

The start is every dollar contributed, $7,200.00, as if it was invested on the first buy, January 15. The end is ending wealth, $8,088.10, on December 15. That span is 334 days. 334/365 is about 0.915068493.

POWER
=POWER(B2/B1,1/B3)-1
=334/365B4
One start, one end
AB
1Value
2Contributions7200
3Ending wealth8088.10
4Years0.9151
5CAGR13.5540%
A picture of CAGR. $7,200.00 to $8,088.10 in 334/365 of a year. Four decimals show 13.5540%. This is not the XIRR.
=POWER(8088.10/7200,1/(334/365))-1

Four decimals show 13.5540%. It is lower than 16.5252% because most of the $7,200.00 was not invested on January 15. Harbor Electric, Maple Software, and River Bank were bought later. XIRR sees those dates. CAGR does not. Use XIRR for the personal return. Use the CAGR line when you want the single start-and-end rate the LAMBDA page describes.


Template for this article

Stock and Dividend Portfolio Tracker

More from the blog