Financial.SLN(Double, Double, Double) 方法
定义
返回一个值,该值指定资产在一个周期内的直线折旧。Returns a value specifying the straight-line depreciation of an asset for a single period.
public:
static double SLN(double Cost, double Salvage, double Life);
public static double SLN (double Cost, double Salvage, double Life);
static member SLN : double * double * double -> double
Public Function SLN (Cost As Double, Salvage As Double, Life As Double) As Double
参数
- Cost
- Double
必需。Required. 资产的原始成本。The initial cost of the asset.
- Salvage
- Double
必需。Required. 资产在使用年限结束时的价值。The value of the asset at the end of its useful life.
- Life
- Double
必需。Required. 资产的使用年限。The length of the useful life of the asset.
返回
资产在一个周期内的直线折旧。The straight-line depreciation of an asset for a single period.
例外
Life = 0.Life = 0.
示例
此示例使用 SLN 函数在给定资产初始成本的情况下,在单个期间内返回资产的直线折旧 InitCost) ,资产的使用年限结束时的残值 (SalvageVal) , (年资产的总寿命 (LifeTime) 。This example uses the SLN function to return the straight-line depreciation of an asset for a single period given the asset's initial cost (InitCost), the salvage value at the end of the asset's useful life (SalvageVal), and the total life of the asset in years (LifeTime).
Dim InitCost, SalvageVal, LifeTime, DepYear As Double
Dim Fmt As String = "###,##0.00"
InitCost = CDbl(InputBox("What's the initial cost of the asset?"))
SalvageVal = CDbl(InputBox("Enter the asset's value at end of its life."))
LifeTime = CDbl(InputBox("What's the asset's useful life in years?"))
' Use the SLN function to calculate the deprecation per year.
Dim SlnDepr As Double = SLN(InitCost, SalvageVal, LifeTime)
Dim msg As String = "The depreciation per year: " & Format(SlnDepr, Fmt)
msg &= vbCrLf & "Year" & vbTab & "Linear" & vbTab & "Doubling" & vbCrLf
' Use the SYD and DDB functions to calculate the deprecation for each year.
For DepYear = 1 To LifeTime
msg &= DepYear & vbTab &
Format(SYD(InitCost, SalvageVal, LifeTime, DepYear), Fmt) & vbTab &
Format(DDB(InitCost, SalvageVal, LifeTime, DepYear), Fmt) & vbCrLf
Next
MsgBox(msg)
注解
此折旧期必须以与参数相同的单位表示 Life 。The depreciation period must be expressed in the same unit as the Life argument. 所有自变量都必须是正数。All arguments must be positive numbers.