Straight line depreciation is the most simple way of calculating the depreciation of an asset.
This method simply subtracts a fixed amount from the value of an asset during each period of the asset's lifetime. Therefore, the straight line depreciation for one period is calculated by the following equation:
where,
The Excel SLN function calculates the straight line depreciation of an asset for one period.
The format of the function is:
where the arguments are:
cost    The initial cost of the asset. 
salvage    The value of the asset at the end of the depreciation. 
life    The number of periods over which the asset is to be depreciated. 
The examples below show the SLN function, used to calculate the yearly or monthly depreciation of assets with different cost, salvage and lifetime values.
Formulas:
 
Results:

Further examples of the Excel SLN function are provided on the Microsoft Office website.
If you get an error from the Excel SLN Function, this is likely to be one of the following:
#DIV/0!    Occurs if the supplied life argument is equal to 0. 
#VALUE!    Occurs if any of the supplied arguments are nonnumeric values. 