The major advantage of investing in a tax-exempt municipal bond fund is that the dividends paid by the fund are tax free, since the interest paid on the bonds owned by the fund is tax free. However, if you sell your shares of a tax-exempt bond fund, you will incur either a taxable capital gain or deductible loss. If your tax free dividends have been reinvested, they must be included in your calculations, otherwise you will end up paying tax you do not really owe.

Gather the year end mutual fund statements for each year you have owned the fund plus the most recent statement. Mutual fund companies put all of your transactions for the year on the year end statement. It is a good idea to keep a file of these statements.

Add together the total amount of all of your investments in the fund. If you just made a one-time investment to open the account, this step is easy. If you have made additional investments, total them to get the total amount of money you have invested in the fund.

Add up the dollar amounts of all reinvested dividends. The reinvested dividends are your money also and increase your basis in the account. The year end fund statements should show the total amount of dividends earned and reinvested for the year.

Add together the amount from your investments and the total of the reinvested dividends and divide this total by the number of shares in your fund account. This result is your average cost basis per share.

Separate the number of fund shares you owned for longer than one year and the shares owned for one year or less. You pay different tax rates on short term holdings and on longer term investments. The cutoff is one year.

Multiply the number of shares owned one year or less first by the calculated cost basis per share and then by the share price at which the shares were sold. The difference between the two numbers is your short term capital gain or loss. If the sale price per share is the higher number, you have a capital gain, which will be taxed at your regular income tax rate.

Multiply the number of shares owned longer than a year first by the calculated cost basis per share and then by the price at which each of the shares was sold. The difference between the two numbers is your long term capital gain or loss. If you have a gain on the fund sale, both the long term and short term will be a gain with the amount proportional to the number of shares owned in each category -- short and long term.

Multiply the amount of your short term gain -- if you have a gain -- times your marginal income tax rate. Your marginal rate is the tax bracket at your total amount of taxable income. Multiply your long term gain by 15 percent if your marginal tax bracket is 25 percent or higher. Add the two amounts together for the taxes to be paid on your tax-free mutual fund sale.

#### Tips

If you end up with a capital loss on your sale of mutual fund shares the loss can be used to offset other gains or reduce your taxable income. Complete Schedule D of your tax return to determine how the loss will be allocated. If your tax bracket is lower than 25 percent, long term gains are taxed at a 0 percent rate.

#### Warnings

This calculation method is the average cost basis to calculate gains or losses on your mutual fund. You can also chooses a first-in, first-out method on the shares, which could change the amount of short and long term gains slightly. For a tax-free bond fund, the amount of gain or loss will usually not be significantly different using either method. The FIFO method is much more time consuming to calculate.