Depreciation Recapture is really easy once you understand it.
First, find out what the G/L is based on the straight-line basis of depreciation. Second compare that G/L with the excess depreciation taken as tax relief. Finally, take the lesser of the excess depreciation or the gain as ordinary income. The rest is a capital gain.
Example (and I'm making these numbers up so if they don't make sense based on actual straight-line and MACRS, it's not important)
Buidling bought for 400,000:
Sold for: 500,000
Straight-line depreciation 120,000
Excess Depreciation: 40,000
Gain: 220,000 (500,000 – 280000)
Of that 220,000, ordinary income is $40,000 (the depreciation recapture) and the rest is capital.
Basically if the excess depreciation is greater than the actual gain, you take the whole gain as ordinary income.
Basis: 400,000
Sold for: 300,000
Depreciation: 120,000
Excess Depreciation: 40,000
Gain: 20,000 (300,000 – 280,000)
Since the Gain is only 20,000, it's all going to be ordinary since there is nothing left over to go as a capital gain.
Does that make sense? Did I explain it correctly?