I'd like to sell one mutual fund and buy another. Will there be any penalties or tax implications?

QUESTION: I want to sell one mutual fund and use the money to buy another. What process do I need to follow? Will there be penalties or tax implications?

-- Anonymous

ANSWER: If you've got a profit in a mutual fund held in a taxable account, selling shares will indeed be a taxable event, says Don Cassidy, senior research analyst at investment-research firm Lipper. But whether or not you'll be smacked with a penalty to boot depends on the share class you hold and how long you've been invested in the fund.

First, let's discuss taxes. As you probably know, mutual-fund shareholders are hit with taxes in two different ways. First, they pay annual tax bills on the net profits mutual-fund managers realize each year. By law, mutual funds must pass on nearly all of their realized gains and losses to shareholders in the form of annual distributions, says Cassidy. These distributions can include capital gains as well as dividend and interest payments. (Tax-efficient mutual funds try to reduce their annual tax liability by offsetting gains with losses.)

Assuming your investment in the fund was profitable, you'll also pay taxes when you sell your fund shares. Don't worry -- you aren't being taxed twice. In this case, you're paying taxes on the gains in the portfolio that were not yet realized by the portfolio manager. To calculate your taxes here, you'll have to determine the cost basis for the sold shares. Your fund company may be able to provide this information to you, but that's not always the case, so be prepared to crunch the numbers yourself, says Todd Trubey, a mutual-fund analyst with investment-research Morningstar. If all of the shares were acquired in one block, that won't be too difficult. Once you sell, just add the cost of the shares at the time you bought, and then add back all capital-gains distributions to the cost basis (if reinvested over the years), since you've already paid tax on them.

If you've bought shares of the mutual fund at different times, however, and don't plan to sell all of your shares at once, you can choose from four different ways to calculate your cost basis -- and you need to pay attention here, because choosing the best method could save you a lot of money. The trick is to make your decision before you sell, as you'll need to specify which method should be used. If possible, ask your broker for a report on all of the transactions and charges on your account, says Cassidy. If you work with an accountant, he or she should then be able to tell you which method will be most beneficial.

So what are your options? Well, first there's the "first-in, first-out" method, or FIFO, which assumes that the shares you sell first are the ones you bought first. Next, the "specific ID" method requires you to specify exactly which block of shares you want to sell. With the "single-category average basis" method, you just take the average cost-basis of all your shares. And with the "double-category average basis" method you have to separate your shares into two pools, with your long-term holdings (more than 12 months) in one and the short-term ones in another. Then you can choose which pool to sell from.

Keep in mind that you can offset your capital-gains hit by selling some of your loser funds, suggests Morningstar's Trubey. And no matter what, make sure you've held the fund for at least a year, so that you avoid short-term capital gains, which are taxed at ordinary income rates, Trubey says. Long-term capital gains, on the other hand, are taxed at only 15%.

Now let's move on to penalties. If you're selling a fund at a loss, one penalty you need to watch out for is the dreaded wash-sale rule, which disallows capital losses if you sell and buy the same security within 31 days before or after the sale. Fortunately, with mutual funds this isn't very likely, explains Cassidy, since you'd have to immediately buy the same fund or one that's identical to the one you sold. (The only situation where things get murky is with index funds, because they normally hold the same shares as the index they follow.)

Aside from that, the only other penalty you may incur is if you hold a fund that carries a back-end load. Back-end loads, which are typical for Class B shares, usually start at 5% to 7% if you sell the fund within a year of buying it, and go down by 1% each year until they disappear. So the longer you hold a back-end load fund, the lower the sales commission you must pay. Owners of front-end or level load funds (Class A and Class C shares, respectively) and no-load funds don't pay a fee when they sell.

One final note: We've assumed for this answer that you're holding a fund in a taxable account. If, however, the fund is held in a tax-advantaged account like an IRA, selling one fund and buying another within the account won't trigger any tax hit or penalties. On the other hand, a nonqualified withdrawal could make you subject to both.