You might be thinking to yourself, "Goodness -- mutual funds buy and sell shares of stock each day. Do I have to account for each such transaction?" The answer is no, you don't. But you do have to account for the shares of the mutual fund that you sold during the year. And if you're like many people, regularly buying shares of various funds each month, perhaps even having your dividends reinvested in additional shares, the accounting can quickly begin to seem insurmountably complicated. It isn't, though -- as long as you've kept good records of when and how you got each share.

Gains and losses
The first thing to calculate for the shares sold is their cost basis. This will depend on how you received them. If you purchased them, your cost basis is the purchase price. If you got the shares as part of a dividend reinvestment plan, the cost basis is their price at the time of purchase.

If you inherited the shares, the cost basis is usually their fair market value (the "net asset value") on the date of death of the decedent (the person who passed away). If the shares were given to you as a gift, things get a bit more complicated. Check out the additional reading for more information relative to the cost basis of your shares if you receive them by gift.

Once you have the initial cost basis for the shares, you'll need to continue to add the cost of additional shares purchased to your basis. If you received a dividend that was reinvested back into additional shares in the fund, you should increase your basis by the amount of the dividend, thereby incorporating the value of the dividend in your basis.

Many people believe that reinvested mutual fund dividends are simply taxable income and not the purchase of additional shares. Nothing could be further from the truth. Look at it this way: The mutual fund company gives you a dividend check. And then you turn right around and purchase additional mutual fund shares with that dividend check. So actually, as you can see, you are buying additional shares -- you're just bypassing the hassle of receiving the dividend check and then sending the mutual fund company another check for payment of the additional shares. And you're buying those shares at different times and at different prices. So record-keeping is key when dealing with mutual funds.

Identifying shares sold
When accounting for mutual fund shares sold, you have more choices than with individual securities. With individual stock, you're stuck with either the First In-First Out (FIFO) method or the Specific Shares method. With mutual fund shares, you can use either of these two methods, or you can average the cost of the shares.

With the Specific Identification Method, you keep records of when you acquired each share of a mutual fund, and you clearly specify which ones you're selling when placing the order, just as with stock.

The First In-First Out (FIFO) method means you specify that the shares sold were the first ones you owned. So if you accumulated 337 shares over many years and then sell 50 shares, you'll be subtracting the adjusted basis for the first 50 shares you owned from the sale price in order to determine your gain or loss. The disadvantage is that this method can maximize your gain, as your earliest shares are likely to have the lowest basis. The upside is that since you've held them the longest, these shares are most likely to qualify for the lower long-term tax rate.

Your third option is averaging the cost of all your shares. It might sound simple, but there are actually two ways it can be done: the Single Category Method and the Multiple Category Method.

With the Single Category Method, you add up the purchase prices of all the shares you have and then divide by the total number of shares. For example, let's say that you started out with 100 shares of the ABC Fund, purchased for $50 each. Later, you bought 100 more shares, at $60 each. In the meantime, your dividends have been reinvested and you get a notice that you received five shares, purchased at $52 each. With the Single Category Method, you average them as follows:

100 shares @ $50 = $5,000
100 shares @ $60 = $6,000
5 shares @ $52 = $260
205 shares totaling $11,260

$11,260 divided by 205 equals a cost basis of $54.93 per share.

So if at some point you sell 50 shares for $65 each, you calculate your gain using a cost basis of $54.93. You record your gains or losses on Schedule D. This cost basis will remain in effect until you acquire more shares. Then you'll have to recalculate. Note also that you still have to pay attention to holding periods. Whenever you sell any share, you'll have to figure out its holding period and its appropriate tax rate. But no matter what the holding period and tax rate, with the Single Category Method, the cost basis is the same.

Next up, the Multiple Category Method. This is pretty much the same as the Single Category Method, but you average the shares in subsets, according to holding period. It is further complicated when you sell off shares over time. You'll have to recalculate, incorporating new shares acquired in the interim and recategorizing all the shares as their holding periods change.

The Multiple Category Method is a little more work, but it often decreases the taxes you pay. To use this method, you should make all the calculations whenever you sell any shares. Here's an example of what your results might look like:

Short-term shares (held for a year or less):
200 shares @ $40 = $8,000 (Bought this April)
100 shares @ $30 = $3,000 (Bought this May)
5 shares @ $32 = $160 (Bought this June)
305 shares totaling $11,160 = average cost basis of $36.59 per share

Long-term shares (held for more than a year):
200 shares @ $28 = $5,600 (Bought last April)
200 shares totaling $5,600 = average cost basis of $28 per share

With this method, when selling shares, you simply use the cost basis that corresponds to the holding period of the shares you're selling. So if you were selling shares you'd held for 14 months, your cost basis would be $28 per share.

As time marches on, shares in your short-term category will eventually become long-term holdings as long as they remain in your portfolio.

You should choose the method that serves you best, but know that with some methods, you'll have to stick with them for as long as you hold shares in that particular fund.

Most reputable mutual fund companies will provide cost basis information for you when you sell your shares -- averaged according to the Single Category Method. That's nice of them to do, and it might take a lot of pressure off of you at tax time when you're reporting your mutual fund sales. But you should also remember that if you transfer mutual fund shares from one broker to another, the cost basis information could be lost. And there are still mutual fund companies out there that don't provide you with cost basis information on shares sold. So you had better know how you stand with your broker or mutual fund company as to the computation of your cost basis for tax purposes. If they don't do it for you, you're forced to do it yourself. And even if they do provide that information, you don't have to have to use the method chosen for you by the mutual fund company. You can use the method that best suits your needs and tax planning.

And one other caveat: Whatever method you select, you're stuck with that method for that specific fund for as long as you're invested in that fund. In our example above with the ABC Fund, the single category average cost method was used. That's an election that was made, and that same method must be used for as long as you own the ABC Fund. But there is nothing in the law that will not allow for a different method if you're invested in the XYZ Fund, even if both of those funds are in the same fund "family."

While we're touching briefly on the subject of mutual funds here: Something not every Fool realizes is that even tax-exempt mutual funds leave you with taxable gains or losses. Most of the income produced from the fund might be tax-exempt, but the fund can produce some taxable income (perhaps if it sells bonds at a taxable gain) and the shares themselves remain taxable assets upon sale.

You can read much more about mutual fund taxation issues in IRS Publications 564 and 550. Many of the issues can be a bit complicated and difficult to understand, but you should be familiar with them if you decide to invest in mutual funds.

Roy Lewis may soon be evicted from his trailer down by the river and is a motivational speaker when not dealing with tax issues, and he understands that The Motley Fool is all about investors writing for investors. You can take a look at the stocks he owns as long as you promise not to ask him which stock to buy. He'll be glad to help you compute your gain or loss when you finally sell a stock, though.