Let's say that on January 1, 2001, you sold some commercial real estate. The total price was $600,000, of which $500,000 was allocated to the building and $100,000 was for the land underneath. Selling expenses were $37,500. You originally purchased the property 10 years ago for $300,000 ($250,000 for the building and $50,000 for the land). Over the years you've claimed $61,168 in depreciation using the straightline method. For simplicity, we'll assume you're a cheapskate and made no capital improvements to the building during the time you owned it.
The buyers made a $200,000 down payment and will pay the rest off at 10 percent interest on a 20year amortization schedule, except that at five years the unpaid principal will be due in a balloon payment.
First, separate the transaction into two portions: the building, and the land:
Building  Land  
Cost basis:  $250,000  $50,000  
Less: depreciation  61,168

0


188,832  50,000  
Plus: expenses of sale  +31,250

+6,250


Adjusted basis:  $220,082  $56,250 
Now let's consider the "building only" portion of the transaction. Your net gains on the sale of the building alone will be the sales price minus the adjusted basis computed above, or $500,000  $220,082 = $279,918. Since this amount is greater than the $61,168 in depreciation, all of the depreciation you claimed over the years would be "recaptured" and taxed in the year of the sale.
The remainder of your profit on the building, or $218,750 (since $279,918  $61,168 = $218,750) would be divided by the selling price of $500,000 to arrive at your gross profit percentage for the building: $218,750/$500,000 = .4375, or 43.75 percent.
For the land, no depreciation was deductible, so there is no recapture. Your profit on the land is the price less the adjusted basis, or $100,000  $56,250 = $43,750. Your gross profit percentage of the land would be $43,750/100,000 = .4375, or 43.75 percent.
For every payment you receive, including the down payment and the balloon, separate the principle from any interest (all interest is taxed as ordinary income).
Of the principal, 1/6 will represent a payment for the land, and 5/6 will
represent a payment for the building. Of the payment for the land, 43.75 percent
will be taxed as capital gains, and the remainder is a return of your capital
which is not taxed. Of the payment for the land, 43.75 percent of each payment
will be taxed as capital gains, and the rest represents either the recaptured
depreciation, which was taxed in the year of the sale, or the return of your
capital which is not taxed.