vb6parse 1.0.1

vb6parse is a library for parsing and analyzing VB6 code, from projects, to controls, to modules, and forms.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="VB6Parse Library Reference - ddb - Financial">
    <title>ddb - Financial - VB6Parse Library Reference</title>
    <link rel="stylesheet" href="../../../assets/css/style.css">
    <link rel="stylesheet" href="../../../assets/css/docs-style.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css">
    <script src="../../../assets/js/theme-switcher.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/vbnet.min.js"></script>
    <script>hljs.highlightAll();</script>
</head>
<body>
    <header class="docs-header">
        <div class="container">
            <h1><a href="../../../index.html">VB6Parse</a> / <a href="../../../library/index.html">Library</a> / <a href="../../../library/functions/financial/index.html">Financial</a> / ddb</h1>
            <p class="tagline">VB6 Library Reference</p>
        </div>
    </header>

    <nav class="docs-nav">
        <div class="container">
            <a href="../../../index.html">Home</a>
            <a href="../../../library/index.html">Library Reference</a>
            <a href="../../../documentation.html">Documentation</a>
            <a href="https://docs.rs/vb6parse" target="_blank">API Docs</a>
            <a href="https://github.com/scriptandcompile/vb6parse" target="_blank">GitHub</a>
            <button id="theme-toggle" class="theme-toggle" aria-label="Toggle theme">
                <span class="theme-icon">🌙</span>
            </button>
        </div>
    </nav>

    <main class="container">
        
        <article class="library-item">
            <h1 id="ddb-function">DDB Function</h1>
<p>Returns a Double specifying the depreciation of an asset for a specific time period using
the double-declining balance method or some other method you specify.</p>
<h2 id="syntax">Syntax</h2>
<pre><code class="language-vbnet">DDB(cost, salvage, life, period[, factor])</code></pre>
<h2 id="parameters">Parameters</h2>
<ul>
<li><strong>cost</strong>: Required. Double specifying initial cost of the asset.</li>
<li><strong>salvage</strong>: Required. Double specifying value of the asset at the end of its useful life.</li>
<li><strong>life</strong>: Required. Double specifying length of useful life of the asset.</li>
<li><strong>period</strong>: Required. Double specifying period for which asset depreciation is calculated.</li>
<li><strong>factor</strong>: Optional. Variant specifying rate at which the balance declines. If omitted,
  2 (double-declining method) is assumed.</li>
</ul>
<h2 id="return-value">Return Value</h2>
<p>Returns a Double representing the depreciation amount for the specified period. The return
value uses the same time units as the life parameter.</p>
<h2 id="remarks">Remarks</h2>
<p>The <code>DDB</code> function calculates depreciation using the double-declining balance method,
which computes depreciation at an accelerated rate. Depreciation is highest in the first
period and decreases in successive periods.
<strong>Important Characteristics:</strong>
- Uses accelerated depreciation (more in early periods)
- Default factor is 2.0 (double-declining balance)
- Factor of 1.5 gives 150% declining balance
- All arguments must be positive numbers
- The life and period arguments must use the same units (years, months, etc.)
- Depreciation never reduces asset value below salvage value
- More accurate than straight-line for assets that lose value quickly
- Commonly used for tax purposes and financial reporting</p>
<h2 id="formula">Formula</h2>
<p>The double-declining balance method uses:</p>
<pre><code class="language-text">Depreciation = (Book Value - Salvage) × (Factor / Life)
Where:
- Book Value = Cost - Accumulated Depreciation from prior periods
- Factor = Declining balance rate (default 2.0)
- Life = Total useful life of asset</code></pre>
<p>The function ensures that depreciation does not reduce the book value below salvage value.</p>
<h2 id="examples">Examples</h2>
<h3 id="basic-usage">Basic Usage</h3>
<pre><code class="language-vbnet">&#x27; Calculate depreciation for equipment
Dim cost As Double
Dim salvage As Double
Dim life As Double
Dim depreciation As Double
cost = 10000      &#x27; $10,000 initial cost
salvage = 1000    &#x27; $1,000 salvage value
life = 5          &#x27; 5 year useful life
&#x27; First year depreciation (double-declining)
depreciation = DDB(cost, salvage, life, 1)
&#x27; Returns 4000 (40% of 10000)
&#x27; Second year depreciation
depreciation = DDB(cost, salvage, life, 2)
&#x27; Returns 2400 (40% of 6000)</code></pre>
<h3 id="custom-declining-factor">Custom Declining Factor</h3>
<pre><code class="language-vbnet">&#x27; 150% declining balance
Dim depreciation As Double
depreciation = DDB(10000, 1000, 5, 1, 1.5)
&#x27; Uses 30% rate instead of 40%
&#x27; Straight-line equivalent (factor = 1)
depreciation = DDB(10000, 1000, 5, 1, 1)</code></pre>
<h3 id="complete-depreciation-schedule">Complete Depreciation Schedule</h3>
<pre><code class="language-vbnet">Sub ShowDepreciationSchedule()
    Dim cost As Double
    Dim salvage As Double
    Dim life As Double
    Dim period As Integer
    Dim depreciation As Double
    cost = 10000
    salvage = 1000
    life = 5
    Debug.Print &quot;Year&quot;, &quot;Depreciation&quot;, &quot;Book Value&quot;
    For period = 1 To life
        depreciation = DDB(cost, salvage, life, period)
        Debug.Print period, Format(depreciation, &quot;Currency&quot;), _
                    Format(cost - TotalDepreciation(period), &quot;Currency&quot;)
    Next period
End Sub</code></pre>
<h2 id="common-patterns">Common Patterns</h2>
<h3 id="calculate-total-accumulated-depreciation">Calculate Total Accumulated Depreciation</h3>
<pre><code class="language-vbnet">Function AccumulatedDepreciation(cost As Double, salvage As Double, _
                                 life As Double, currentPeriod As Integer) As Double
    Dim total As Double
    Dim i As Integer
    total = 0
    For i = 1 To currentPeriod
        total = total + DDB(cost, salvage, life, i)
    Next i
    AccumulatedDepreciation = total
End Function</code></pre>
<h3 id="calculate-current-book-value">Calculate Current Book Value</h3>
<pre><code class="language-vbnet">Function BookValue(cost As Double, salvage As Double, _
                   life As Double, currentPeriod As Integer) As Double
    Dim accumulated As Double
    accumulated = AccumulatedDepreciation(cost, salvage, life, currentPeriod)
    BookValue = cost - accumulated
End Function</code></pre>
<h3 id="compare-depreciation-methods">Compare Depreciation Methods</h3>
<pre><code class="language-vbnet">Sub CompareDepreciationMethods(cost As Double, salvage As Double, life As Double)
    Dim period As Integer
    Dim ddbDepr As Double
    Dim slnDepr As Double
    Debug.Print &quot;Period&quot;, &quot;DDB&quot;, &quot;SLN&quot;
    For period = 1 To life
        ddbDepr = DDB(cost, salvage, life, period)
        slnDepr = SLN(cost, salvage, life)
        Debug.Print period, Format(ddbDepr, &quot;Currency&quot;), _
                    Format(slnDepr, &quot;Currency&quot;)
    Next period
End Sub</code></pre>
<h3 id="monthly-depreciation">Monthly Depreciation</h3>
<pre><code class="language-vbnet">Function MonthlyDDB(cost As Double, salvage As Double, _
                    lifeYears As Double, month As Integer) As Double
    &#x27; Calculate depreciation by month instead of year
    Dim lifeMonths As Double
    lifeMonths = lifeYears * 12
    MonthlyDDB = DDB(cost, salvage, lifeMonths, month)
End Function</code></pre>
<h3 id="partial-year-depreciation">Partial Year Depreciation</h3>
<pre><code class="language-vbnet">Function PartialYearDDB(cost As Double, salvage As Double, life As Double, _
                        year As Integer, monthsInFirstYear As Integer) As Double
    &#x27; Handle assets purchased mid-year
    If year = 1 Then
        PartialYearDDB = DDB(cost, salvage, life, 1) * (monthsInFirstYear / 12)
    Else
        Dim priorYearPartial As Double
        Dim currentYearPartial As Double
        priorYearPartial = DDB(cost, salvage, life, year - 1) * _
                          ((12 - monthsInFirstYear) / 12)
        currentYearPartial = DDB(cost, salvage, life, year) * _
                            (monthsInFirstYear / 12)
        PartialYearDDB = priorYearPartial + currentYearPartial
    End If
End Function</code></pre>
<h3 id="depreciation-rate-calculation">Depreciation Rate Calculation</h3>
<pre><code class="language-vbnet">Function DepreciationRate(life As Double, Optional factor As Double = 2) As Double
    &#x27; Calculate the depreciation rate percentage
    DepreciationRate = (factor / life) * 100
End Function
&#x27; Usage
rate = DepreciationRate(5)      &#x27; Returns 40% for 5-year DDB
rate = DepreciationRate(5, 1.5) &#x27; Returns 30% for 5-year 150% DB</code></pre>
<h3 id="asset-register-with-ddb">Asset Register with DDB</h3>
<pre><code class="language-vbnet">Type Asset
    Description As String
    Cost As Double
    Salvage As Double
    Life As Double
    PurchaseDate As Date
End Type
Function CalculateAssetDepreciation(asset As Asset, currentYear As Integer) As Double
    Dim yearsOwned As Integer
    yearsOwned = Year(Date) - Year(asset.PurchaseDate)
    If yearsOwned &gt;= currentYear And currentYear &lt;= asset.Life Then
        CalculateAssetDepreciation = DDB(asset.Cost, asset.Salvage, _
                                        asset.Life, currentYear)
    Else
        CalculateAssetDepreciation = 0
    End If
End Function</code></pre>
<h3 id="switch-to-straight-line-detection">Switch to Straight-Line Detection</h3>
<pre><code class="language-vbnet">Function ShouldSwitchToSLN(cost As Double, salvage As Double, _
                           life As Double, period As Integer) As Boolean
    &#x27; Determine if switching to SLN would give higher depreciation
    Dim ddbAmount As Double
    Dim slnAmount As Double
    Dim bookValue As Double
    Dim remainingLife As Double
    ddbAmount = DDB(cost, salvage, life, period)
    bookValue = BookValue(cost, salvage, life, period - 1)
    remainingLife = life - period + 1
    slnAmount = (bookValue - salvage) / remainingLife
    ShouldSwitchToSLN = (slnAmount &gt; ddbAmount)
End Function</code></pre>
<h3 id="tax-depreciation-calculator">Tax Depreciation Calculator</h3>
<pre><code class="language-vbnet">Function TaxDepreciation(cost As Double, salvage As Double, _
                        life As Double, taxYear As Integer, _
                        Optional method As String = &quot;DDB&quot;) As Double
    Select Case UCase(method)
        Case &quot;DDB&quot;
            TaxDepreciation = DDB(cost, salvage, life, taxYear)
        Case &quot;150DB&quot;
            TaxDepreciation = DDB(cost, salvage, life, taxYear, 1.5)
        Case &quot;SLN&quot;
            TaxDepreciation = SLN(cost, salvage, life)
        Case Else
            TaxDepreciation = 0
    End Select
End Function</code></pre>
<h2 id="advanced-usage">Advanced Usage</h2>
<h3 id="depreciation-schedule-generator">Depreciation Schedule Generator</h3>
<pre><code class="language-vbnet">Function GenerateDepreciationSchedule(cost As Double, salvage As Double, _
                                     life As Double) As Variant
    &#x27; Returns 2D array: Period, Depreciation, Accumulated, Book Value
    Dim schedule() As Variant
    Dim period As Integer
    Dim depreciation As Double
    Dim accumulated As Double
    ReDim schedule(1 To life, 1 To 4)
    accumulated = 0
    For period = 1 To life
        depreciation = DDB(cost, salvage, life, period)
        accumulated = accumulated + depreciation
        schedule(period, 1) = period
        schedule(period, 2) = depreciation
        schedule(period, 3) = accumulated
        schedule(period, 4) = cost - accumulated
    Next period
    GenerateDepreciationSchedule = schedule
End Function</code></pre>
<h3 id="hybrid-depreciation-method">Hybrid Depreciation Method</h3>
<pre><code class="language-vbnet">Function HybridDepreciation(cost As Double, salvage As Double, _
                           life As Double, period As Integer) As Double
    &#x27; Use DDB but switch to SLN when SLN gives higher amount
    Dim ddbAmount As Double
    Dim slnAmount As Double
    Dim bookValue As Double
    Dim remainingLife As Double
    ddbAmount = DDB(cost, salvage, life, period)
    If period &gt; 1 Then
        bookValue = BookValue(cost, salvage, life, period - 1)
        remainingLife = life - period + 1
        slnAmount = (bookValue - salvage) / remainingLife
        HybridDepreciation = Application.Max(ddbAmount, slnAmount)
    Else
        HybridDepreciation = ddbAmount
    End If
End Function</code></pre>
<h3 id="multi-asset-depreciation-report">Multi-Asset Depreciation Report</h3>
<pre><code class="language-vbnet">Sub GenerateDepreciationReport(assets() As Asset, fiscalYear As Integer)
    Dim i As Integer
    Dim totalDepreciation As Double
    Dim assetDepreciation As Double
    totalDepreciation = 0
    Debug.Print &quot;Asset&quot;, &quot;Cost&quot;, &quot;Life&quot;, &quot;Year&quot;, &quot;Depreciation&quot;
    For i = LBound(assets) To UBound(assets)
        Dim yearsSincePurchase As Integer
        yearsSincePurchase = fiscalYear - Year(assets(i).PurchaseDate) + 1
        If yearsSincePurchase &gt; 0 And yearsSincePurchase &lt;= assets(i).Life Then
            assetDepreciation = DDB(assets(i).Cost, assets(i).Salvage, _
                                   assets(i).Life, yearsSincePurchase)
            Debug.Print assets(i).Description, _
                       Format(assets(i).Cost, &quot;Currency&quot;), _
                       assets(i).Life, _
                       yearsSincePurchase, _
                       Format(assetDepreciation, &quot;Currency&quot;)
            totalDepreciation = totalDepreciation + assetDepreciation
        End If
    Next i
    Debug.Print &quot;Total Depreciation:&quot;, Format(totalDepreciation, &quot;Currency&quot;)
End Sub</code></pre>
<h3 id="optimal-method-selector">Optimal Method Selector</h3>
<pre><code class="language-vbnet">Function OptimalDepreciationMethod(cost As Double, salvage As Double, _
                                  life As Double, period As Integer, _
                                  taxRate As Double) As String
    &#x27; Determine which method gives best tax benefit
    Dim ddbAmount As Double
    Dim slnAmount As Double
    Dim ddbTaxSavings As Double
    Dim slnTaxSavings As Double
    ddbAmount = DDB(cost, salvage, life, period)
    slnAmount = SLN(cost, salvage, life)
    ddbTaxSavings = ddbAmount * taxRate
    slnTaxSavings = slnAmount * taxRate
    If ddbTaxSavings &gt; slnTaxSavings Then
        OptimalDepreciationMethod = &quot;DDB&quot;
    Else
        OptimalDepreciationMethod = &quot;SLN&quot;
    End If
End Function</code></pre>
<h3 id="financial-statement-generator">Financial Statement Generator</h3>
<pre><code class="language-vbnet">Sub GenerateDepreciationFootnote(cost As Double, salvage As Double, _
                                life As Double, currentYear As Integer)
    Dim schedule As Variant
    Dim i As Integer
    Debug.Print &quot;Depreciation is calculated using the double-declining balance method:&quot;
    Debug.Print &quot;Asset cost: &quot; &amp; Format(cost, &quot;Currency&quot;)
    Debug.Print &quot;Salvage value: &quot; &amp; Format(salvage, &quot;Currency&quot;)
    Debug.Print &quot;Useful life: &quot; &amp; life &amp; &quot; years&quot;
    Debug.Print
    Debug.Print &quot;Year&quot;, &quot;Depreciation&quot;, &quot;Net Book Value&quot;
    For i = 1 To currentYear
        Dim depr As Double
        Dim bookVal As Double
        depr = DDB(cost, salvage, life, i)
        bookVal = BookValue(cost, salvage, life, i)
        Debug.Print i, Format(depr, &quot;Currency&quot;), Format(bookVal, &quot;Currency&quot;)
    Next i
End Sub</code></pre>
<h3 id="macrs-alternative-comparison">MACRS Alternative Comparison</h3>
<pre><code class="language-vbnet">Function CompareDDBToMARS(cost As Double, life As Double) As Variant
    &#x27; Compare DDB to MACRS (Modified Accelerated Cost Recovery System)
    &#x27; This is simplified; actual MACRS uses specific tables
    Dim comparison() As Variant
    Dim period As Integer
    Dim ddbTotal As Double
    Dim salvage As Double
    salvage = 0 &#x27; MACRS assumes zero salvage
    ReDim comparison(1 To life, 1 To 3)
    For period = 1 To life
        comparison(period, 1) = period
        comparison(period, 2) = DDB(cost, salvage, life, period)
        comparison(period, 3) = BookValue(cost, salvage, life, period)
    Next period
    CompareDDBToMARS = comparison
End Function</code></pre>
<h2 id="error-handling">Error Handling</h2>
<pre><code class="language-vbnet">Function SafeDDB(cost As Double, salvage As Double, life As Double, _
                 period As Integer, Optional factor As Double = 2) As Variant
    On Error GoTo ErrorHandler
    &#x27; Validate inputs
    If cost &lt; 0 Or salvage &lt; 0 Or life &lt;= 0 Or period &lt;= 0 Then
        SafeDDB = CVErr(xlErrNum)
        Exit Function
    End If
    If salvage &gt;= cost Then
        SafeDDB = 0
        Exit Function
    End If
    If period &gt; life Then
        SafeDDB = 0
        Exit Function
    End If
    SafeDDB = DDB(cost, salvage, life, period, factor)
    Exit Function
ErrorHandler:
    SafeDDB = CVErr(xlErrValue)
End Function</code></pre>
<h3 id="common-errors">Common Errors</h3>
<ul>
<li><strong>Error 5</strong> (Invalid procedure call): Negative values for cost, salvage, life, or period</li>
<li><strong>Error 5</strong>: Life or period equals zero</li>
<li><strong>Error 5</strong>: Salvage value exceeds cost</li>
</ul>
<h2 id="performance-considerations">Performance Considerations</h2>
<ul>
<li><code>DDB</code> involves iterative calculations for periods &gt; 1</li>
<li>Cache results when calculating multiple periods for same asset</li>
<li>For complete schedules, calculate once and store array</li>
<li>More complex than <code>SLN</code> but still efficient</li>
<li>Consider pre-calculating depreciation schedules for reporting</li>
</ul>
<h2 id="best-practices">Best Practices</h2>
<h3 id="validate-parameters">Validate Parameters</h3>
<pre><code class="language-vbnet">&#x27; Good - Validate before calculation
If cost &gt; 0 And salvage &gt;= 0 And salvage &lt; cost And life &gt; 0 Then
    depreciation = DDB(cost, salvage, life, period)
End If
&#x27; Avoid - May cause runtime error
depreciation = DDB(cost, salvage, life, period)</code></pre>
<h3 id="use-consistent-time-units">Use Consistent Time Units</h3>
<pre><code class="language-vbnet">&#x27; Good - Both in years
depreciation = DDB(10000, 1000, 5, 2)
&#x27; Good - Both in months
depreciation = DDB(10000, 1000, 60, 24)
&#x27; Avoid - Mixing units
depreciation = DDB(10000, 1000, 5, 24)  &#x27; Mixing years and months</code></pre>
<h3 id="consider-switching-methods">Consider Switching Methods</h3>
<pre><code class="language-vbnet">&#x27; Many businesses switch from DDB to SLN mid-life
&#x27; to maximize depreciation deductions
If ShouldSwitchToSLN(cost, salvage, life, period) Then
    depreciation = CalculateSLNForRemaining(cost, salvage, life, period)
Else
    depreciation = DDB(cost, salvage, life, period)
End If</code></pre>
<h3 id="document-depreciation-assumptions">Document Depreciation Assumptions</h3>
<pre><code class="language-vbnet">&#x27; Good - Document method and assumptions
&#x27; Depreciation calculated using double-declining balance (200%)
&#x27; Useful life: 5 years, Salvage: 10% of cost
depreciation = DDB(cost, cost * 0.1, 5, currentYear)</code></pre>
<h2 id="comparison-with-other-functions">Comparison with Other Functions</h2>
<h3 id="ddb-vs-sln">DDB vs SLN</h3>
<pre><code class="language-vbnet">&#x27; DDB - Accelerated depreciation (higher early, lower later)
depr = DDB(10000, 1000, 5, 1)  &#x27; Returns 4000
&#x27; SLN - Straight-line (same every year)
depr = SLN(10000, 1000, 5)     &#x27; Returns 1800</code></pre>
<h3 id="ddb-vs-syd">DDB vs SYD</h3>
<pre><code class="language-vbnet">&#x27; DDB - Double-declining balance
depr = DDB(10000, 1000, 5, 1)  &#x27; Returns 4000
&#x27; SYD - Sum-of-years digits (also accelerated)
depr = SYD(10000, 1000, 5, 1)  &#x27; Returns 3000</code></pre>
<h3 id="ddb-with-different-factors">DDB with Different Factors</h3>
<pre><code class="language-vbnet">&#x27; Double-declining (200%)
depr = DDB(10000, 1000, 5, 1, 2)    &#x27; Returns 4000 (40% rate)
&#x27; 150% declining balance
depr = DDB(10000, 1000, 5, 1, 1.5)  &#x27; Returns 3000 (30% rate)
&#x27; Straight-line equivalent
depr = DDB(10000, 1000, 5, 1, 1)    &#x27; Returns 1800 (20% rate)</code></pre>
<h2 id="limitations">Limitations</h2>
<ul>
<li>Does not automatically switch to SLN (must implement manually)</li>
<li>Does not handle mid-period purchases automatically</li>
<li>Does not conform to specific tax codes (MACRS, etc.)</li>
<li>Requires manual handling of disposal before end of life</li>
<li>Cannot directly calculate accumulated depreciation (must sum periods)</li>
<li>Does not handle negative depreciation or write-ups</li>
</ul>
<h2 id="related-functions">Related Functions</h2>
<ul>
<li><code>SLN</code>: Straight-line depreciation (constant per period)</li>
<li><code>SYD</code>: Sum-of-years digits depreciation (accelerated)</li>
<li><code>VDB</code>: Variable declining balance (can switch to SLN automatically)</li>
<li><code>FV</code>: Future value (general financial calculation)</li>
<li><code>PV</code>: Present value (general financial calculation)</li>
</ul>
        </article>
        
        <div style="margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border-color);">
            <p>
                <a href="index.html">← Back to Financial</a> |
                <a href="../index.html">View all functions</a>
            </p>
        </div>

    </main>

    <footer>
        <div class="container">
            <p>&copy; 2024-2026 VB6Parse Contributors. Licensed under the MIT License.</p>
        </div>
    </footer>
</body>
</html>