Home › Templates › Cost basis spreadsheet

Cost Basis Spreadsheet: Stock and ETF Lot Tracker

A free cost basis spreadsheet for Excel and Google Sheets. Log every buy, reinvested dividend, fee and stock split, then see the basis, the realized gain and the short- or long-term split of each sale by FIFO, average cost or the specific lot you sold, with a Form 8949 box and a wash-sale screen for every line.

Download Excel template (.xlsx) 713 KB · no macros · Excel 2016+ and Google Sheets · v1.0, 3 Nov 2026

Use it in Google Sheets: choose File → Import → Upload in Sheets and pick the .xlsx, or upload it to Google Drive and open it with Google Sheets. No sign-up, no add-on and no broker connection: you type your trades from the confirmations.

Preview: the Example Sales tab. The portfolio is fictional: the six-letter tickers (STOCKA, STOCKB, STOCKC, FUNDXC, ETFXXD) are made up, and so is every price and date.
−$420.80short-term gain or loss in 2025
$2,201.29long-term gain or loss in 2025
$1,780.49total realized, 4 sales in 2025
1 flagloss sale with a same-ticker buy within 30 days (2025)
TickerSoldSharesMethodNet proceedsBasis usedGain / lossTermAcquired8949 boxWash-sale screen
STOCKA8 Apr 2025120FIFO6,607.055,046.931,560.12Both: report 2 linesVARIOUSA/D
FUNDXC21 Apr 2025150Average cost3,855.003,719.69135.31Long-term10 Jan 2024D
STOCKC12 Sep 202540FIFO1,315.05749.99565.06Long-term17 May 2010E
STOCKB20 Oct 202560Specific lot (STOCKB-2)4,320.004,800.00−480.00Short-term15 Jan 2025APossible wash sale: 25 shares bought within 30 days
ETFXXD20 Jan 202680FIFO5,072.004,896.00176.00Long-term6 Jan 2025D
FUNDXC17 Feb 2026120Average cost2,880.002,979.63−99.63Long-termVARIOUSDPossible wash sale: 4.3 shares bought within 30 days
STOCKA2 Mar 202630FIFO1,494.001,562.97−68.97Long-term3 Sep 2024DLoss: no same-ticker buy within 30 days in this file
STOCKB15 Jun 202650Specific lot (STOCKB-1)4,050.003,500.00550.00Long-term6 Nov 2023D
Example Sales (fictional): realized gain or loss of each sale if FIFO, if average cost, and with the method used. STOCKA 8 Apr 2025: FIFO $1,560.12, average $1,319.13, used (FIFO) $1,560.12; FUNDXC 21 Apr 2025: FIFO $105.00, average $135.31, used (Average cost) $135.31; STOCKC 12 Sep 2025: FIFO $565.06, average $565.06, used (FIFO) $565.06; STOCKB 20 Oct 2025: FIFO $120.00, average −$147.69, used (Specific lot) −$480.00; ETFXXD 20 Jan 2026: FIFO $176.00, average $227.20, used (FIFO) $176.00; FUNDXC 17 Feb 2026: FIFO −$65.96, average −$99.63, used (Average cost) −$99.63; STOCKA 2 Mar 2026: FIFO −$68.97, average $117.44, used (FIFO) −$68.97; STOCKB 15 Jun 2026: FIFO $350.00, average $361.78, used (Specific lot) $550.00.If FIFOIf averageMethod usedSTOCKA · Apr 20251,560FUNDXC · Apr 2025135STOCKC · Sep 2025565STOCKB · Oct 2025−480ETFXXD · Jan 2026176FUNDXC · Feb 2026−100STOCKA · Mar 2026−69STOCKB · Jun 2026550

Chart: each example sale's gain or loss if FIFO, if average cost, and with the method actually chosen, from the same file. Dollar figures throughout this page are from the fictional example.

Planning a tax-loss sale instead? The tax-loss harvesting spreadsheet starts from the total basis your broker shows for each open lot and looks forward: unrealized losses, harvest candidates, Schedule D netting and the $3,000 limit. This cost basis spreadsheet works out that basis from your trades and looks back: what each sale cost, by which method, and which Form 8949 box it belongs in.

What's inside the spreadsheet

TabWhat you typeWhat it calculates
Start hereNothingSteps, the IRS rules used, method limits, colour key, disclaimer
LotsUp to 300 rows: ticker, trade date, type (Buy or Reinvested dividend), security type (Stock, ETF, Mutual fund, DRIP shares), shares, price, fees, other basis adjustment (+/−), notesLot ID, a row check, total cost basis, split factor, split-adjusted shares, basis per share, the date after which the lot is long-term, shares left and basis left in the lot
SalesUp to 300 rows: ticker, trade date, shares, price, selling fees, method (FIFO, Specific lot, Average cost), lot ID for a specific-lot sale, whether the 1099-B shows basis reported to the IRSStatus, cost basis used, gain or loss, short-term / long-term / both, date acquired (or VARIOUS), Form 8949 box for each part, wash-sale screen, method warnings, and the FIFO and average basis of every sale side by side
SplitsUp to 50 splits or reverse splits: ticker, effective date, new shares for each old shareConverts earlier lots and sales to today's share count; dollar basis never changes
SummaryOptional tax yearShort- and long-term totals, wash-sale flags and data checks for the year; proceeds, basis and gain per Form 8949 box A–F; a table and native chart by tax year; per ticker: shares held, basis left, basis per share and realized gain by the method used, if all FIFO and if all average
Example Lots, Example Sales, Example Splits, Example SummaryAlready filledA fictional portfolio: 21 lots (9 of them reinvested dividends), one 3-for-1 split and 8 sales across 2025 and 2026

How to use it

  1. Open Lots. Add one row per purchase and one per dividend reinvestment, in any order. Copy the trade date, shares, price and commission from each confirmation. Mark the security type: Stock, ETF, Mutual fund or DRIP shares.
  2. If a statement shows a basis change, type it in Other basis adjustment: plus for a disallowed wash-sale loss added to replacement shares, minus for a nondividend distribution (return of capital). Check column K says OK.
  3. Had a split? Add it once on Splits with the effective date and the ratio (3 for 3-for-1, 0.1 for 1-for-10). Do not edit the old lots; the file converts them.
  4. Open Sales. Add each sale in date order for that ticker: trade date, shares, price and selling fees. Pick the method. For a specific-lot sale, pick the lot ID your broker confirmed. Answer Basis reported to IRS? from your Form 1099-B (Yes, No, or No 1099-B).
  5. Check column J says OK. Read the basis used, the gain, the term and the Form 8949 box. An amber cell means check this: a possible wash sale, a sale with both short- and long-term shares, or a method warning.
  6. Open Summary. Type the tax year (or leave it blank for the latest year). Compare the box A–F totals with your 1099-B before you file.

The IRS rules the sheet uses

What goes into basis

IRS Publication 551: "The basis of stocks or bonds you buy is generally the purchase price plus any costs of purchase, such as commissions and recording or transfer fees." (IRS, Pub. 551, Basis of Assets). Publication 550 adds that the basis "must be adjusted for certain events that occur after purchase", such as stock splits and nondividend distributions (IRS, Pub. 550, Investment Income and Expenses).

FINRA puts the investor's side plainly: the cost basis "is generally your purchase price for the securities, including reinvested dividends or reinvested capital gains distributions, plus additional costs such as the commission or other fees you paid", and "You're responsible for reporting your cost basis information accurately to the IRS" (FINRA, Cost Basis Basics).

Which shares you sold: three methods

MethodWhen the IRS allows itHow the sheet does it
FIFOThe default. Pub. 550: if you "cannot adequately identify the shares you sell, the basis of the securities you sell is the basis of the securities you acquired first."Lines each ticker's lots up by trade date and takes shares from the front
Specific lotWhen you adequately identify the shares: you "Tell your broker or other agent the particular stock to be sold or transferred at the time of the sale" and "Receive a written confirmation of this" within a reasonable time.Uses the basis per share of the lot ID you pick and checks the lot has enough shares left
Average costOnly for identical shares left with a custodian or agent that are mutual fund (or other regulated investment company) shares or DRIP shares, after you elect it in writing with the custodian. Pub. 550: "Except for certain mutual fund shares, discussed later, you cannot use the average price per share to figure gain or loss on the sale of the shares."Divides the basis of all shares held by the number held, just before each sale. Warns on lots marked Stock (and asks you to check an ETF's structure)

Under average cost, the holding period still follows the oldest shares. Pub. 550: "To determine your holding period, the shares disposed of are considered to be those acquired first." So one average-cost sale can have short- and long-term parts, as in its LJO Mutual Fund example. The sheet splits it the same way.

Use one method per ticker. The FIFO and average columns are what-ifs that assume every sale of that ticker used that method, and a note appears if one ticker mixes methods.

Short-term or long-term

"If you hold investment property more than 1 year, any capital gain or loss is a long-term capital gain or loss. If you hold the property 1 year or less, any capital gain or loss is a short-term capital gain or loss." Counting begins "on the date after the day you acquired the property", and for exchange-traded securities the period runs from the day after the trade date you bought to the trade date you sold (Pub. 550). The Lots tab shows the cut-off for each lot: STOCKA-2, bought 3 Sep 2024, is long-term if sold after 3 Sep 2025.

Stock splits and reinvested dividends

Pub. 550 tells you to figure the basis of stock splits "in the same way as stock dividends if identical stock is distributed", dividing the old basis over the old and new shares. A dividend reinvested through a plan is new stock with its own basis and holding period, and "you must still report the dividends as income." If the plan sells you shares at a discount, "your basis is the full fair market value of the stock on the dividend payment date."

Covered, noncovered and the Form 8949 boxes

The Form 8949 instructions: "Generally, a covered security is any of the following. Stock you acquired after 2010 (generally after 2011, if in a mutual fund or other regulated investment company, or acquired through a DRP)." For covered sales the broker reports basis to the IRS; "If Form 1099-B ... shows that the cost or other basis was reported to the IRS, always report the basis shown on that form" and make any correction in column (g) (IRS, Instructions for Form 8949).

Wash sales: a screen, not a calculation

Pub. 550: "A wash sale occurs when you sell or trade stock or securities at a loss and within 30 days before or after the sale you" buy substantially identical stock or securities, acquire them in a fully taxable trade, acquire a contract or option to buy them, or acquire them for your IRA or Roth IRA. A purchase by your spouse or a corporation you control also counts. The disallowed loss is added to the basis of the new shares.

The sheet flags a loss sale when this file has same-ticker shares bought within 30 days before or after it, other than the shares sold. Reinvested dividends count, because they are purchases. It cannot see your other accounts, IRAs or your spouse's trades, or decide what is "substantially identical", and it does not change any basis. Treat a flag as a reason to check your 1099-B and, for confirmed amounts, use the Other basis adjustment column and code W on Form 8949.

The formulas, explained

Exact formulas from the file, row 8. On Lots, B is the ticker, C the date, F the shares, G the price, H the fees, I the adjustment, K the row check. On Sales, A is the ticker, B the date, C the shares and F the method; the grey helper columns from AC onwards hold the intermediate steps.

FieldFormula
Lots: total cost basis (L8)=IF($K8="OK",F8*G8+N(H8)+N(I8),"")
Lots: split factor since bought (M8)=IF($K8="OK",EXP(SUMIFS(Splits!$F$8:$F$57,Splits!$A$8:$A$57,B8,Splits!$B$8:$B$57,">"&C8)),"")
Lots: shares today, split-adjusted (N8)=IF($K8="OK",F8*M8,0)
Lots: basis per split-adjusted share (O8)=IF($K8="OK",L8/N8,0)
Lots: long-term if sold after (P8)=IF($K8="OK",EDATE(C8,12),0)
Lots: FIFO queue start (R8)=IF($K8="OK",SUMIFS($N$8:$N$307,$B$8:$B$307,B8,$Q$8:$Q$307,"<"&Q8,$W$8:$W$307,1),0)
Sales: shares sold, split-adjusted (AE8)=IF(AC8="OK",C8*AD8,0)
Sales: FIFO start in the ticker's queue (AF8)=IF(AC8="OK",SUMIFS($AE$8:$AE$307,$A$8:$A$307,A8,$AT$8:$AT$307,"<"&AT8,$AC$8:$AC$307,"OK"),0)
Sales: FIFO basis (U8)=IF(AC8="OK",SUMPRODUCT((Lots!$W$8:$W$307=1)*(Lots!$B$8:$B$307=$A8)*(((($AG8)+(Lots!$S$8:$S$307)-ABS(($AG8)-(Lots!$S$8:$S$307)))/2-(($AF8)+(Lots!$R$8:$R$307)+ABS(($AF8)-(Lots!$R$8:$R$307)))/2)+ABS((($AG8)+(Lots!$S$8:$S$307)-ABS(($AG8)-(Lots!$S$8:$S$307)))/2-(($AF8)+(Lots!$R$8:$R$307)+ABS(($AF8)-(Lots!$R$8:$R$307)))/2))/2*Lots!$O$8:$O$307),"")
Sales: average basis (V8)=IF(AC8="OK",IF(AM8-AN8>0.000001,AE8*(AL8-AO8)/(AM8-AN8),0),"")
Sales: specific-lot basis (AQ8)=IF(N(AP8)>0,AE8*INDEX(Lots!$O$8:$O$307,AP8),0)
Sales: cost basis used (K8)=IF(J8<>"OK","",IF(F8="FIFO",U8,IF(F8="Average cost",V8,AQ8)))
Sales: gain or loss (L8)=IF(J8<>"OK","",S8-K8)
Sales: short / long-term (M8)=IF(J8<>"OK","",IF(AS8<=0.000001,"Long-term",IF(AS8>=AE8-0.000001,"Short-term","Both: report 2 lines")))
Sales: Form 8949 box, short-term part (O8)=IF(OR(J8<>"OK",AS8<=0.000001),"",IF(H8="Yes","A",IF(H8="No","B",IF(H8="No 1099-B","C","?"))))
Sales: shares bought in the 61-day window (AX8)=IF(AC8="OK",SUMIFS(Lots!$N$8:$N$307,Lots!$B$8:$B$307,A8,Lots!$W$8:$W$307,1,Lots!$C$8:$C$307,">="&(B8-30),Lots!$C$8:$C$307,"<="&(B8+30)),0)
Sales: wash-sale screen (Q8)=IF(OR(J8<>"OK",N(L8)>=0),"",IF(AX8-AY8>0.000001,"Possible wash sale: "&ROUND(AX8-AY8,4)&" shares bought within 30 days","Loss: no same-ticker buy within 30 days in this file"))
Summary: short-term gain, year shown (B12)=SUMIFS(Sales!$Y$8:$Y$307,Sales!$AU$8:$AU$307,$B$5)
Summary: Form 8949 box A proceeds (C24)=SUMIFS(Sales!$W$8:$W$307,Sales!$O$8:$O$307,"A",Sales!$AU$8:$AU$307,$B$5)

Splits without editing old rows. Each lot gets a split factor: the product of the ratios of every later split of that ticker, written as EXP(SUMIFS(LN ratios)) because spreadsheets have no PRODUCTIFS. Shares × factor gives today's share count. Sales get the same factor for splits after the sale date, so every share in the file is counted in the same units and the dollar basis never moves.

FIFO without macros. Each ticker's lots form a queue ordered by trade date: lot i holds positions from start to start + shares (column R). Each sale takes the next positions after the shares sold before it. The FIFO basis is the overlap of the sale's range with each lot's range, times that lot's basis per share, summed with SUMPRODUCT. MIN and MAX are written with ABS (min(x,y) = (x + y − |x − y|) / 2) because they do not work element by element inside SUMPRODUCT. The same overlap gives the short-term shares, the lots used and the shares bought in the wash-sale window.

Average cost. For each sale: (basis of all shares bought up to the sale date − basis already sold under average) ÷ (shares bought − shares already sold) × shares sold. This is the IRS worksheet in Pub. 550: total adjusted basis of the shares owned just before the sale, divided by the number of shares owned.

Checked against the IRS examples. With Pub. 550's Table 4-2 data (160 shares at $25, 240 at $20, 10 reinvested at $30; 210 sold) the sheet gives a FIFO basis of $5,000, as the IRS does, and an average basis of $4,660.98. The IRS rounds the average to $22.20 a share and gets $4,662. Its LJP fund example (an average of $16, 150 shares sold) gives $2,400. Its holding-period dates (31 Jan 2024 to 29 Jan 2025 short-term, to 6 Feb 2025 long-term), its split example ($45 basis, three shares, $15 each) and its wash-sale example (replacement shares with a $1,050 basis) all come out the same. check.py recomputes every value with a separate Python simulation.

Worked example from the sample data

The Example tabs hold a fictional portfolio: three stocks, one mutual fund with quarterly reinvested dividends and one ETF. None of the tickers, prices or dates are real.

Lot IDAcquiredTypeSecuritySharesPriceFeesCost basisShares todayBasis / shareLong-term if sold afterShares left
STOCKC-117 May 2010BuyStock4018.509.99749.994018.749717 May 20110
STOCKB-16 Nov 2023BuyStock30210.000.006,300.009070.00006 Nov 202440
FUNDXC-110 Jan 2024BuyMutual fund20025.000.005,000.0020025.000010 Jan 20250
STOCKA-112 Feb 2024BuyStock10040.004.954,004.9510040.049512 Feb 20250
FUNDXC-228 Mar 2024Reinvested dividendMutual fund3.91225.560.0099.993.91225.560028 Mar 20250
FUNDXC-327 Jun 2024Reinvested dividendMutual fund4.11824.890.00102.504.11824.890027 Jun 20250
FUNDXC-415 Jul 2024BuyMutual fund10024.100.002,410.0010024.100015 Jul 202538.03
STOCKA-23 Sep 2024BuyStock5052.004.952,604.955052.09903 Sep 20250
FUNDXC-526 Sep 2024Reinvested dividendMutual fund5.625.920.00145.155.625.920026 Sep 20255.6
FUNDXC-627 Dec 2024Reinvested dividendMutual fund5.5526.710.00148.245.5526.710027 Dec 20255.55
ETFXXD-16 Jan 2025BuyETF8061.200.004,896.008061.20006 Jan 20260
STOCKB-215 Jan 2025BuyStock20240.000.004,800.006080.000015 Jan 20260
FUNDXC-727 Mar 2025Reinvested dividendMutual fund5.726.400.00150.485.726.400027 Mar 20265.7
STOCKA-316 Jun 2025BuyStock4047.250.001,890.004047.250016 Jun 202640
FUNDXC-826 Jun 2025Reinvested dividendMutual fund3.925.100.0097.893.925.100026 Jun 20263.9
STOCKB-34 Aug 2025BuyStock4576.000.003,420.004576.00004 Aug 202645
FUNDXC-925 Sep 2025Reinvested dividendMutual fund425.600.00102.40425.600025 Sep 20264
STOCKB-45 Nov 2025BuyStock2570.000.001,750.002570.00005 Nov 202625
ETFXXD-21 Dec 2025BuyETF2058.000.001,160.002058.00001 Dec 202620
FUNDXC-1029 Dec 2025Reinvested dividendMutual fund4.125.200.00103.324.125.200029 Dec 20264.1
FUNDXC-1112 Mar 2026Reinvested dividendMutual fund4.324.300.00104.494.324.300012 Mar 20274.3

A FIFO sale with short- and long-term parts

On 8 Apr 2025, 120 STOCKA shares are sold at $55.10 with a $4.95 fee: net proceeds $6,607.05. FIFO takes all 100 shares of STOCKA-1 ($4,004.95, bought 12 Feb 2024, held more than a year) and 20 of STOCKA-2 at $52.0990 a share ($1,041.98, bought 3 Sep 2024). Basis $5,046.93, gain $1,560.12: $1,500.92 long-term in box D and $59.19 short-term in box A. Average cost would have given $5,287.92, but STOCKA is a stock, so average cost is not an option.

A mutual fund on average cost

FUNDXC has two purchases and quarterly reinvested dividends. Just before the 21 Apr 2025 sale the fund lots hold 324.88 shares with $8,056.36 of basis: $24.7980 a share. 150 shares × that average = $3,719.69, against $3,750.00 under FIFO. The shares sold count as the oldest ones (bought 10 Jan 2024), so the gain of $135.31 is long-term. On 17 Feb 2026 a second sale closes at a $99.63 loss, and the dividend reinvested on 12 Mar 2026 (4.3 shares) is within 30 days, so the screen says: Possible wash sale: 4.3 shares bought within 30 days.

A split, a specific lot and a wash-sale flag

STOCKB had a 3-for-1 split effective 1 Jul 2025. STOCKB-2 was 20 shares at $240.00 ($4,800.00); today that is 60 shares at $80.00. On 20 Oct 2025 the investor tells the broker to sell exactly that lot: 60 shares at $72.00 for $4,320.00. Basis $4,800.00, a short-term loss of $480.00. FIFO would have sold the older, cheaper STOCKB-1 shares for a basis of $4,200.00 and a gain. On 5 Nov 2025, 16 days after the loss sale, the investor buys 25 more STOCKB shares (STOCKB-4), so the screen says: Possible wash sale: 25 shares bought within 30 days. Whether it is a wash sale, and for how much, is for the investor and the 1099-B to settle; if it is, Pub. 550 says the disallowed loss is added to the cost of the new shares.

Noncovered shares

STOCKC was bought on 17 May 2010, before covered-security reporting began, and the broker's 1099-B shows no reported basis. The sale on 12 Sep 2025 is long-term and goes in box E: proceeds $1,315.05, basis $749.99 (including the $9.99 commission), gain $565.06. This is the case where your own records carry the basis.

The 2025 summary

Form 8949What goes thereProceedsCost basisGain / lossLines
Part I, box AShort-term, basis reported to IRS5,421.185,841.98−420.802
Part I, box BShort-term, basis not reported to IRS0.000.000.000
Part I, box CShort-term, no Form 1099-B0.000.000.000
Part II, box DLong-term, basis reported to IRS9,360.887,724.641,636.232
Part II, box ELong-term, basis not reported to IRS1,315.05749.99565.061
Part II, box FLong-term, no Form 1099-B0.000.000.000

4 sales in 2025: −$420.80 short-term and $2,201.29 long-term, $1,780.49 in total. If every sale had used FIFO, the total would be $2,350.18; with average cost everywhere, $1,871.80. Those what-ifs include stocks, where average cost is not allowed. They show how much the method moves the result.

Holdings by ticker

TickerMethod usedShares heldBasis leftBasis / share nowRealized gainIf all FIFOIf all average
STOCKCFIFO00.00–565.06565.06565.06
STOCKBSpecific lot1107,970.0072.4570.00470.00214.09
FUNDXCAverage cost71.181,765.1424.8035.6839.0435.68
STOCKAFIFO401,890.0047.251,491.151,491.151,436.57
ETFXXDFIFO201,160.0058.00176.00176.00227.20

STOCKB now holds 110 split-adjusted shares with $7,970.00 of basis left, $72.45 a share, because the specific-lot sales took the shares named, not the oldest ones.

Common mistakes

Limits

FAQ

How do I calculate the cost basis of a stock?

Start with what you paid and add the costs of buying. IRS Publication 551 says the basis of stocks or bonds you buy "is generally the purchase price plus any costs of purchase, such as commissions and recording or transfer fees." Add reinvested dividends as new purchases, spread the basis over the new share count after a split, and subtract the basis of shares you have sold. The Lots tab does this per lot: shares × price + fees ± adjustments.

Can I use average cost basis for individual stocks?

Generally no. IRS Publication 550 says that if you cannot identify the shares you sold, you use the shares acquired first, and "Except for certain mutual fund shares, discussed later, you cannot use the average price per share to figure gain or loss on the sale of the shares." The average basis method is for identical shares held with a custodian or agent that are mutual fund (or other regulated investment company) shares or DRIP shares. The sheet shows a warning if you pick Average cost for a lot marked Stock.

What is the FIFO method for cost basis?

First in, first out: the oldest shares count as sold first. Publication 550 makes it the default when you cannot adequately identify the shares you sold, and FINRA describes it the same way. With specific identification you name the lot at the time of the sale and get a written confirmation from your broker. The Sales tab shows both, plus the average cost figure, so you can compare.

Do reinvested dividends increase my cost basis?

Yes. Each reinvestment buys new shares, and their cost is added to your basis. FINRA's example: a $1,000 investment with $100 and $300 of reinvested dividends has an adjusted cost basis of $1,400, so a $1,500 sale is a $100 gain, not $500. The dividends themselves are still taxable income in the year paid. Publication 550: "you must still report the dividends as income."

How do stock splits affect cost basis?

Your total basis stays the same and is spread over more (or fewer) shares. Publication 550's example: one share bought for $45 becomes three shares after a distribution of two new shares for each share held, so each share has a basis of $15. Enter each split once on the Splits tab and keep the original share counts and prices on Lots.

What is the difference between covered and noncovered securities?

For a covered security your broker reports the basis to the IRS on Form 1099-B. The Form 8949 instructions say a covered security is generally "Stock you acquired after 2010 (generally after 2011, if in a mutual fund or other regulated investment company, or acquired through a DRP)." For noncovered shares you are responsible for the basis yourself, which is where a lot tracker helps most. The answer decides the Form 8949 box: A/D, B/E or C/F.

When is a stock gain long-term?

When you held the shares more than 1 year. Publication 550: "begin counting on the date after the day you acquired the property. The day you disposed of the property is part of your holding period." Its example: bought 31 January 2024, sold 29 January 2025 is short-term; sold 6 February 2025 is long-term. Use trade dates, not settlement dates. The Lots tab shows the date after which each lot turns long-term.

Can I use this cost basis spreadsheet in Google Sheets?

Yes. In Google Sheets choose File → Import → Upload and pick the .xlsx, or upload it to Google Drive and open it with Google Sheets. The formulas use IF, AND, OR, NOT, N, INT, ABS, ROUND, LN, EXP, ISNUMBER, IFERROR, COUNTA, COUNTIF, COUNTIFS, SUMIFS, SUMPRODUCT, INDEX, MATCH, EDATE, YEAR, TODAY, LEN, TRIM, LEFT, SEARCH, MIN, MAX and SUM, which work in Excel 2016+, Google Sheets and LibreOffice. No macros and no dynamic arrays.

Related tools and templates

Educational template only, not tax, legal or investment advice. Example data is fictional: the tickers, prices, dates and trades are made up to show the formulas and are not a recommendation. IRS rules are quoted from Publication 550 (2025), Publication 551 (12/2025) and the Instructions for Form 8949 (2025); FINRA material is quoted from finra.org. All were retrieved on 3 November 2026. Tax rules change; check the current IRS publications or a tax professional for your situation.