The service life and residual value of a long-lived asset are estimates because no one knows how long the asset will provide service. Thus, when you sell or dispose of an asset, the amount realized, if any, is likely to differ from its net book value. If the amount realized is more than the book value, there is a gain, and if less, there is a loss. The entry removes both the asset's cost and its accumulated depreciation. For example, if a machine was sold for $4,000 cash at the end of the 90th month and its cost was $12,000, its accumulated depreciation is $9,000, so its net book value is $3,000. The following entry records the receipt of cash, the gain, and the removal of the asset and its accumulated depreciation from the books:
The gain or loss on the sale of a long-lived asset is treated just like revenue (if a gain) or expenses (if a loss) on the income statement of the period in which the asset is sold or discarded.
Note that the procedure for recording depreciation expense does not involve cash. Cash was paid out, or a liability was created, when the asset was acquired. Thereafter, the accounting entries for depreciation charge only a fraction of the acquisition cost to each accounting period.
Some people believe that Accumulated Depreciation represents an amount of cash that is available to buy new assets. The amount of cash that an entity has is reported as the Cash item on its balance sheet, nowhere else.