傳回 Double,指定資產在指定期間內的年總位數折舊。

語法

SYD ( 成本、殘餘、生命、期間 )

SYD 函數語法具有下列自變數:

引數

描述

成本

必要。 Double 指定資產的初始成本。

打撈

必要。 Double 會在資產的使用期限結束時指定資產的值。

使用時間

必要。 Double 會指定資產的使用年限長度。

時期

必要。 Double 指定計算資產折舊的期間。

註解

生命 期間自變數必須以相同的單位表示。 例如,如果 生命 週期是以月為 指定,則 期間也必須以月為指定。 所有自變數都必須是正數。

查詢範例

Expression

結果​​

SELECT SYD ([LoanAmount],[LoanAmount]*.1,20,2) AS Expr1 FROM FinancialSample;

將資產值的折舊計算為 「LoanAmount」,其中的殘餘價值為 10% (“LoanAmount” 乘以 0.1) ,並考慮資產的使用年限為 20 年。 這是以第二年計算的折舊。

SELECT SYD ([LoanAmount],0,20,3) AS SLDepreciation FROM FinancialSample;

將資產的使用時間視為 20 年,傳回資產值為 “LoanAmount” 且價值 $0 的折舊。 結果會顯示在 [SLDepreciation] 欄中。 這是以第三年計算的折舊。

VBA 範例

附註: 下列範例示範如何在 Visual Basic for Applications (VBA) 模組中使用此函數。 如需使用 VBA 的詳細資訊,請在 [搜尋] 旁的下拉式清單中選取 [開發人員參考],並在 [搜尋] 方塊中輸入一個或多個字詞。

此範例使用 SYD 函數傳回資產在指定期間內的折舊,以指定資產的初始成本 (InitCost) 、資產實用生命 (SalvageVal) 結尾的殘餘價值,以及資產在年份中的總生命 (LifeTime) 。 計算折舊的年數期間 PDepr

Dim Fmt, InitCost, SalvageVal, MonthLife, LifeTime, DepYear, PDeprConst YEARMONTHS = 12    ' Number of months in a year.Fmt = "###,##0.00"    ' Define money format.InitCost = InputBox("What's the initial cost of the asset?")SalvageVal = InputBox("What's the asset's value at the end of its life?")MonthLife = InputBox("What's the asset's useful life in months?")Do While MonthLife < YEARMONTHS    ' Ensure period is >= 1 year.    MsgBox "Asset life must be a year or more."    MonthLife = InputBox("What's the asset's useful life in months?")LoopLifeTime = MonthLife / YEARMONTHS    ' Convert months to years.If LifeTime <> Int(MonthLife / YEARMONTHS) Then    LifeTime = Int(LifeTime + 1)    ' Round up to nearest year.End If DepYear = CInt(InputBox("For which year do you want depreciation?"))Do While DepYear < 1 Or DepYear > LifeTime    MsgBox "You must enter at least 1 but not more than " & LifeTime    DepYear = CInt(InputBox("For what year do you want depreciation?"))LoopPDepr = SYD(InitCost, SalvageVal, LifeTime, DepYear)MsgBox "The depreciation for year " & DepYear & " is " & Format(PDepr, Fmt) & "."

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。