Skip to main content

Wash Sale Detection in Google Sheets

If you sell a stock or option at a loss and buy a "substantially identical" security shortly before or after, tax regulations in many jurisdictions (such as US IRC §1091) disallow claiming that loss in the current tax year. The disallowed amount is instead added to the cost basis of the replacement shares. This is known as the wash sale rule, and it is one of the most common pitfalls when attempting tax-loss harvesting.

The tradeGIST Google Sheets Portfolio Tracker detects these situations automatically. It adjusts your Profit and Loss (P&L) and cost basis directly in your spreadsheets, ensuring the figures on your Trades sheet accurately reflect your deductible capital losses for the year.

Why Wash Sale Tracking Matters for Tax Loss Harvesting

Without accurate wash sale tracking, your portfolio's reported losses may not match what you can legally deduct. Tax authorities typically do not allow you to claim a capital loss if you maintain your position by buying the security back shortly after selling it.

Instead, the loss is deferred. You only recover this deferred amount when you eventually sell the replacement shares (and stay out of the position long enough to avoid triggering another wash sale).

Skipping this critical tax calculation can lead to:

  • Overstating deductible capital losses for the current tax year.
  • Reporting mismatches when reconciling your spreadsheet against your broker's 1099-B tax form.
  • Unexpected tax bills when your broker reports a different taxable income than you anticipated.

Understanding the 61-Day Wash Sale Window

The standard wash sale window (as used by the IRS and others) spans 61 days in total:

  • 30 days before the sale at a loss.
  • The day of the sale.
  • 30 days after the sale.

Any purchase of substantially identical securities inside this 61-day window triggers a wash sale.

Example 1: Full Wash Sale

Suppose you trade Tesla (TSLA) in USD:

  • March 1st: Buy 10 TSLA at $100 each → cost basis $1,000.
  • March 2nd: Sell all 10 TSLA at $80 each → proceeds $800, realized loss $200.
  • March 15th: Buy 10 TSLA back at $70 each → cost basis $700.

Because the March 15th purchase is within the 30-day window after the loss, the $200 loss is strictly disallowed for this tax year and deferred to the replacement lot:

  • The March 2nd loss row displays: P&L = $0, Wash Sale Adj. = −$200, Realized = FALSE.
  • The March 15th replacement lot displays: Wash Sale Adj. = +$200, Cost Basis = $900 ($700 purchase + $200 deferred loss).

Example 2: Partial Wash Sale

If you only buy back a portion of the shares, only a proportional amount of the loss is deferred:

  • March 1st: Buy 10 TSLA at $100 → cost basis $1,000.
  • March 2nd: Sell all 10 TSLA at $80 → loss $200 ($20 per share).
  • March 3rd: Buy 5 TSLA at $90 → cost basis $450.

You replaced 5 of the 10 shares sold (50%). Therefore, 50% of the loss is disallowed:

  • The loss row displays: P&L = −$100 (the deductible half), Wash Sale Adj. = −$100, Realized = TRUE (a partial wash sale is partially realized).
  • The March 3rd replacement lot displays: Wash Sale Adj. = +$100, Cost Basis = $550 ($450 + $100 deferred).

Example 3: No Wash Sale (Outside the Window)

If your repurchase falls more than 30 days out from the loss, the wash sale rule does not apply:

  • March 1st: Buy 10 TSLA at $100.
  • March 2nd: Sell all 10 TSLA at $80 → loss $200.
  • June 1st: Buy 5 TSLA at $90.

June 1st is approximately 91 days after the loss, well outside the 61-day window. The full $200 capital loss is deductible this year, and the June 1st cost basis remains at $450.

How to Track Wash Sale Adjustments in tradeGIST

After running tradeGIST > Generate Trades, open the Trades sheet and review the Wash Sale Adj. column:

  • Negative value: This row represents a loss that has been fully or partially disallowed. The amount shown is the deferred portion. Compare it against the Asset P&L column to see your original economic loss before the tax adjustment.
  • Positive value: This row's cost basis has been increased by a deferred loss from a previous sale. The Cost Basis column reflects this adjusted basis.
  • Zero or blank: No wash sale rules apply to this transaction.

The Wash Sale Adj. column will always sum to zero across your entire sheet. Every dollar deferred from a loss is transferred to a replacement row's basis.

Tip: The Asset P&L column shows the original unadjusted economic performance, while Net P&L and Tax Value reflect the post-adjustment tax reality.

Configuring Wash Sale Rules

Wash sale detection is disabled by default. When enabled, it utilizes the standard US 30-day window and broker-default rules for matching "substantially identical" securities. You can tweak these settings in the Tax section of the ⚙️ Settings dialog (open the tradeGIST menu and click ⚙️ Settings):

  • Wash sale detection: Master toggle ("Detect wash sales and adjust P&L"). Turn it on if your tax jurisdiction has a wash sale rule (as in the US) and you want to track it. Off by default.
  • Wash sale window (days): The number of days before and after a loss to scan for replacement transactions.
    Default: 30 (creates the US 61-day window).
  • Wash sale method: Determines the strictness of the "substantially identical" test, specifically for matching options contracts. Default: M2.

See the Configuration guide for comprehensive details.

Method 1 vs. Method 2 for Options

Whether two options contracts are "substantially identical" depends on the strictness of your tax approach:

  • Method 2 (M2 - Broker Convention, default): Demands the exact same root, type, strike, and expiration. For example, a TSLA $100 call is not identical to a TSLA $105 call. This matches how most brokers report on a 1099-B and aligns with standard tax software.
  • Method 1 (M1 - Conservative): Requires only the same root and option type. Any TSLA call is considered identical to any other TSLA call. Use this setting for the most aggressive tax-loss harvesting protection.

Note: Cross-asset wash sales (e.g., selling TSLA stock at a loss and buying a TSLA call option within 30 days) always trigger a wash sale under both methods, as strictly applied by most tax authorities.

Substantially Identical Securities: What Counts?

A replacement purchase only triggers a wash sale if the security is "substantially identical" to what you sold. tradeGIST applies these identification rules:

  • Stock to Stock: Same ticker symbol.
  • Stock to Option: Same underlying asset. Selling TSLA stock at a loss and buying a TSLA call within the window counts as a wash sale. However, buying a TSLA put does not count, as it is a bearish exposure.
  • Option to Option: Same underlying asset plus the same type (call/put). Under the default M2 setting, strike and expiry must also match strictly.
  • Directional Exposure: Matching a long stock loss against a new short stock position is never a wash sale due to differing economic exposures.

A Single-Lot Partial Close Is Not a Wash Sale

A wash sale requires a separate replacement purchase. Simply selling part of a single lot at a loss while still holding the rest of that same lot does not trigger a wash sale:

  • May 15th: Buy 10 TSLA at $100.
  • June 1st: Sell 5 TSLA at $80 → loss $100. You still hold the remaining 5 shares from the May 15th purchase.

The remaining 5 shares are just the unsold portion of the same original acquisition — they are not a replacement purchase. The loss is fully realized:

  • The June 1st loss row displays: P&L = −$100, Wash Sale Adj. = $0, Realized = TRUE.
  • The remaining 5 shares keep their original Cost Basis = $500 (5 × $100), unchanged.

This matches how brokers such as Schwab, Fidelity, and Interactive Brokers report on the 1099-B. A wash sale would only arise if, within the window, you made a new purchase of TSLA (see Example 2 above, where the replacement is a distinct buy).

Multi-Currency Tracking and FX Rates

If your base currency differs from the asset's trading currency, the deferred wash sale amount is calculated using your Net P&L in your base currency, factoring in FX fluctuations and fees. The cost basis boost on the replacement row is also applied in your base currency.

Read more in the Multi-Currency Tracking guide.

Disclaimer

The tradeGIST wash sale detection feature is an educational tool designed to help you analyze the tax implications of your trading history. While it strictly models common wash sale guidelines (such as US IRC §1091), individual tax situations are complex and subjective. This is not tax advice.

Always consult a certified tax professional or CPA before filing your taxes, and ensure you cross-reference your generated reports with your broker's official 1099-B document.

For more technical help, consult our FAQ or contact our support team.