Determining the cost basis of stock
I had 5900 shares of stock purchased over an eight year period
Last November I sold shares of 426 shares of xyz corp. @194
The shares had been purchase at various dates in 2017 & 2018 and 2022 at various prices ($168, $174 & $194).
The consolidated tax statement I was sent by my brokerage account shows
$82438 for box 1d proceeds
$20425 for box 1e cost basis
How do brokerage firms determine the cost basis of these shares when the shares I originally were purchased at different times over the years?
You have to ask your broker.
There are several methods that could be used. Basically your broker has to track the individual basis of all your shares. But when you sell, they might sell your newest shares first, or your oldest shares first, or your most expensive shares first, or your cheapest shares first, or maybe some other method entirely. Sometimes you can specify what method to use. If you don't specify, they will use their default method, whatever that is.