Επεξεργασία

Κοινή χρήση μέσω


Financial.SYD(Double, Double, Double, Double) Method

Definition

Returns a value specifying the sum-of-years digits depreciation of an asset for a specified period.

public:
 static double SYD(double Cost, double Salvage, double Life, double Period);
public static double SYD (double Cost, double Salvage, double Life, double Period);
static member SYD : double * double * double * double -> double
Public Function SYD (Cost As Double, Salvage As Double, Life As Double, Period As Double) As Double

Parameters

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.

Period
Double

Required. The period for which asset depreciation is calculated.

Returns

The sum-of-years digits depreciation of an asset for a specified period.

Exceptions

Salvage < 0, Period > Life, or Period <=0.

Examples

This example uses the SYD function to return the depreciation of an asset for a specified 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)

Remarks

The Life and Period arguments must be expressed in the same units. For example, if Life is given in months, Period must also be given in months. All arguments must be positive numbers.

Applies to

See also