<-- Previous || Up || Next -->

Variable Declining Balance Depreciation Verify Sub
Math Financial Class

Private Sub VariableDecliningBalanceDepreciationVerify()
    'Verify that the VariableDecliningBalanceDepreciation function works correctly.

    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 2.2, 2.6, 2, True), 122.88)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 2.2, 3.6, 2, True), 393.216)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 2.2, 4.6, 2, True), 609.4848)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 2.2, 5.6, 2, True), 782.49984)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 2.2, 6.6, 2, True), 920.911872)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 2.2, 7.6, 2, True), 1031.6414976)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 2.2, 8.6, 2, True), 1120.22519808)

    'Following differ from VDB function in Excel:
    'Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 2.2, 2.6, 2, False), 117.9648)
    'Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 2.2, 3.6, 2, False), 389.28384)
    'Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 2.2, 4.6, 2, False), 606.339072)
    'Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 2.2, 5.6, 2, False), 779.9832576)
    'Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 2.2, 6.6, 2, False), 923.630726736842)
    'Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 2.2, 7.6, 2, False), 1056.25698357895)
    'Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 2.2, 8.6, 2, False), 1188.88324042105)

    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 0, 0, 2, True), 0)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 0, 1, 2, True), 480)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 0, 2, 2, True), 864)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 0, 3, 2, True), 1171.2)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 0, 4, 2, True), 1416.96)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 0, 5, 2, True), 1613.568)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 0, 6, 2, True), 1770.8544)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 0, 7, 2, True), 1896.68352)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 0, 8, 2, True), 1997.346816)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 0, 9, 2, True), 2077.8774528)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 0, 10, 2, True), 2142.30196224)
    
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 0, 0, 2, False), 0)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 0, 1, 2, False), 480)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 0, 2, 2, False), 864)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 0, 3, 2, False), 1171.2)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 0, 4, 2, False), 1416.96)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 0, 5, 2, False), 1613.568)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 0, 6, 2, False), 1770.8544)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 0, 7, 2, False), 1903.1408)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 0, 8, 2, False), 2035.4272)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 0, 9, 2, False), 2167.7136)
    Debug.Assert Approx(VariableDecliningBalanceDepreciation(2400, 100, 10, 0, 10, 2, False), 2300)

End Sub

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.