You can not avoid capital gains tax on your gains. the best you could do is defer them by designating this as a 1031 exchange prior to the closing date.
Is this an asset sale or is it a total business (share) sale?
I tried to post and lost the data becasue you were posting at the same time as me.
I was taking my time and trying to give you a detailed resonse. I need to shorten it now, I spent 30 minutes writing my response only to get kicke out. I know you did not know this.
Here it is in a nut shale.
If you did an asset sale, you could do an asset allocation of the salee price to all of your depreciable assets. This tends to be more advantageous to the business seller but not to the buyer. It can reduce your capital gains and profits.
Since you sold it as a business, you have to figure capital gains by the normal capital gains formuala;
Capital gains = sale prioce of the business - (original cost of business, + majore repairs and improvments, - accumlulated depreciation) - cost of selling.
You will end up paying recapture tax on the accumulated depreciation of 25 percent; and capital gains tax of 15 percent of the capitl gain, if you owned the business for 366 days or longer. If you owned the business for 365 days or less, you will pay tax based on regular income of as high as 36 percent.