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.
=B2/B3| A | B | |
|---|---|---|
| 1 | Value | |
| 2 | Dividends | 65.60 |
| 3 | Cost basis | 2000 |
| 4 | Yield on cost | 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(B2:B16,A2:A16)| A | B | |
|---|---|---|
| 1 | Date | Cash |
| 2 | 01/15/2026 | -2000 |
| 3 | 02/02/2026 | -2000 |
| 4 | 03/02/2026 | -2000 |
| 5 | 03/15/2026 | 16 |
| 6 | 04/01/2026 | 15 |
| 7 | 05/04/2026 | -1200 |
| 8 | 06/15/2026 | 16 |
| 9 | 06/30/2026 | 7.50 |
| 10 | 07/01/2026 | 15 |
| 11 | 09/01/2026 | 1040 |
| 12 | 09/15/2026 | 16.80 |
| 13 | 10/01/2026 | 15 |
| 14 | 11/16/2026 | 1320 |
| 15 | 12/15/2026 | 16.80 |
| 16 | 12/15/2026 | 5610 |
| 17 | XIRR | 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(B2/B1,1/B3)-1| A | B | |
|---|---|---|
| 1 | Value | |
| 2 | Contributions | 7200 |
| 3 | Ending wealth | 8088.10 |
| 4 | Years | 0.9151 |
| 5 | CAGR | 13.5540% |
=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.