Is there a function in Wolfram language that compute values and generates such a table ?
For:
Cost of Asset = 5000
Salvage Value =25 %
Duration (Years) =5 years
Rate Depreciation =20 %
with method Depreciation Balance (DBM) ?
I looked in the help pages, but I didn’t find anything there.
Regards M.I.
Reference:
See here.
I will answer my own question:
assetValue = 5000;
salvageValue = 5000*0.25;
assetLife = 5;
depreciationFactor = 1.0;(* because: depreciationFactor/assetLife*100 = Rate Depreciation = 20 %*)
decliningBalanceDepreciation[assetValue_, salvageValue_, assetLife_,
depreciationFactor_] :=
Module[{bookValue = assetValue, depTable = {}},
AppendTo[
depTable, {"Year", "Beginning Book Value", "Depreciation Percent",
"Depreciation Amount", "Accumulated Depreciation",
"Ending Book Value"}];
Do[depreciation =
Min[bookValue - salvageValue,
depreciationFactor*bookValue/assetLife];
accumulatedDepreciation =
If[i == 1, depreciation, Last[depTable][[5]] + depreciation];
endingBookValue = Max[salvageValue, bookValue - depreciation];
AppendTo[
depTable, {i, bookValue, (depreciation/bookValue)*100,
depreciation, accumulatedDepreciation, endingBookValue}];
bookValue = endingBookValue;, {i, 1, assetLife}];
depTable]
Grid[decliningBalanceDepreciation[assetValue, salvageValue, assetLife,
depreciationFactor], Frame -> All]