DB Function in ONLYOFFICE Spreadsheet Editor: Syntax, Worked Examples and Limitations
Step-by-step ONLYOFFICE DB function tutorial with verified vendor syntax, financial worksheet examples, independent numerical expectations and troubleshooting.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
DB calculates one period’s depreciation using a fixed-declining balance. For an asset costing 8,000 with a 1,000 residual value and a three-year life, =DB(8000,1000,3,1) has an independently calculated expense of 4,000 in the first full year.
Availability and version history
- Introduced: The original release and date are not established by the checked official sources.
- Availability: Documented in the current ONLYOFFICE Spreadsheet Editor help; no final supported-version endpoint is established.
- Scope: Docs and Desktop Editors have separate release histories. The rolling help and a May 19, 2026 source snapshot do not certify every older build or mobile client.
- Checked: October 14, 2026, using official DB help, public source inspection and independent arithmetic. No native editor test.
Syntax and arguments
=DB(cost, salvage, life, period, [month])
| Argument | Meaning | Required or default |
|---|---|---|
cost |
Original asset cost | Required |
salvage |
Estimated residual value at the end of its life | Required |
life |
Total useful life, in periods | Required |
period |
Period for which to calculate depreciation; same units as life | Required |
month |
Number of months in the first year | Optional; 12 |
The brackets indicate an optional argument; do not type them. These examples use English names and comma separators. Use a consistent currency for cost and salvage, and years for life and period when modelling a shorter first fiscal year with month. The official function reference establishes the argument order and twelve-month default.
Practice worksheet
Enter these numbers in a blank sheet. Keep them unchanged while entering the result formulas in D2:D8.
| Cell | Value | Meaning |
|---|---|---|
| B2 | 8000 | Purchase cost |
| B3 | 1000 | Residual value |
| B4 | 3 | Life in years |
| B5 | 12 | Full first year |
| B6 | 6 | Alternative six-month first year |
| Output | Formula | Expected amount | Purpose |
|---|---|---|---|
| D2 | =DB(B2,B3,B4,1) |
4000 | First full year |
| D3 | =DB(B2,B3,B4,2) |
2000 | Second full year |
| D4 | =DB(B2,B3,B4,3) |
1000 | Third full year |
| D5 | =DB(B2,B3,B4,1,B5) |
4000 | Explicit default equals omitted month |
| D6 | =DB(B2,B3,B4,1,B6) |
2000 | Six-month first year |
| D7 | =DB(B2,B3,B4,2,B6) |
3000 | Following full year |
| D8 | =DB(3500,500,5,1,10) |
939.166667 | Ten-month example from the official screenshot |
The final row reproduces the vendor’s pictured inputs; the image displays 939.1667. Other values are independent expectations. Format currency results to two decimals if desired, while retaining the unrounded formulas for totals.
How the declining rate works
The fixed rate starts from 1-(salvage/cost)^(1/life). For the main asset, (1000/8000)^(1/3)=0.5, so the declining rate is exactly 50%. Applying it to beginning book value gives expenses of 4,000, 2,000 and 1,000, leaving 1,000.
The short help page does not state the rate-rounding algorithm. The pinned official source rounds the calculated rate to three decimal places before applying it. This is internal rate rounding, separate from formatting an expense to two decimal places. For the official 3,500/500/five-year example, the rounded rate is 0.322, and the first ten-month charge is 3500*0.322*10/12 = 939.166666…. An unrounded-rate model can disagree even when all input cells are correct.
This source snapshot supports the explanation; it is not proof that every historical or customized installation uses identical implementation details.
Build and check a complete schedule
Full-year purchase
In G2:G4 enter periods 1, 2, 3. In H2 enter =DB($B$2,$B$3,$B$4,G2) and fill down to H4. Put =SUM(H2:H4) in H5 and =$B$2-H5 in H6. Expected accumulated depreciation is 7,000, and the closing book value is 1,000.
The dollar signs keep the asset inputs fixed when copying the formula. period changes by row; cost, salvage and life do not. DB returns the individual period’s expense, not the running total.
Purchase halfway through the first fiscal year
On a separate worksheet, enter periods 1, 2, 3, 4 in A2:A5 and =DB(8000,1000,3,A2,6) in B2; fill it down to B5. The expected expenses are 2,000; 3,000; 1,500; 375. =SUM(B2:B5) in B6 gives 6,875, and =8000-B6 in B7 leaves 1,125.
The source uses the unused fraction of the first year for the final reporting period: the last six months apply half of the declining annual rate to the remaining 1,500. A three-year useful life can therefore span four fiscal reporting rows. Notice that this schedule does not automatically force closing book value to exactly the requested salvage amount. Rate rounding and partial-year conventions can leave a residual difference; check the roll-forward before adopting an accounting schedule.
Choosing a depreciation method
- SLN spreads cost less salvage evenly across useful life. The main example’s annual straight-line amount is
7000/3, approximately 2,333.33. - DB derives a fixed declining rate from the cost-to-salvage relationship and supports a shortened first year.
- DDB’s official reference uses a supplied declining factor, defaulting to two. It does not take DB’s month argument.
The function computes a schedule; it does not determine which depreciation policy is appropriate for tax or financial reporting.
Troubleshooting and boundaries
| Problem | Check |
|---|---|
| Partial-year charge looks wrong | Use 6 for six months, not 0.5 or 50%. |
| Every row has the same result | Ensure the period reference changes when the formula is filled down. |
| Hand calculation differs | Use the three-decimal source rate, then distinguish rate rounding from currency display rounding. |
| Closing balance differs from salvage | Reconcile the full schedule, including the final short reporting period; do not substitute salvage for the computed closing balance. |
| Formula is rejected | Check argument order, numeric cell contents, separators and installed editor version. |
Use positive cost, positive life and a residual value below cost for the worked models. The source snapshot has additional boundary handling, but the short help does not enumerate all invalid-input errors. Zero-life, fractional-period, text-coercion and locale-specific error behavior have not been verified in a native editor. For portable workbooks, rerun the schedule after import or export rather than assuming another spreadsheet’s DB implementation is identical.