Use specific identification accounting when selling shares. The IRS generally calculates gains and losses on fund shares with “first-in, first-out” (FIFO) accounting. That means using the price that is paid for the shares that have held the longest. Specific identification accounting allows a taxpayer to sell select shares to provide the best tax result. This method of accounting can create a specific amount of gain that can be matched against an offsetting loss. Specific identification accounting requires more paperwork than the FIFO method.
You bought shares of the same fund first for $10, then $30 and then $60. They are worth $40 now. If you sell a portion of the shares, under FIFO accounting rules you will be deemed to sell the $10 shares first for a $30 taxable gain.
If you are in a combined (federal, self-employment, and state) tax bracket of 20%, you could reduce your taxes up to $200 for every $1,000 of income reduction by using specific identification accounting when selling stock shares.