RAWSUBTRACT Function (LibreOffice Calc)
Learn the RAWSUBTRACT function in LibreOffice Calc: Returns the subtraction of numbers. Like a-b-c but without eliminating small roundoff errors.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Availability and version history
- Introduced: LibreOffice 5.2.
- Availability: Supported in LibreOffice 26.8.1.1, verified against its function registry. This identifies a supported release, not a final working version.
- Scope: Desktop Calc, using the English function name. Availability in other spreadsheet applications is separate.
- Checked: 2026-10-14 — function reference; versioned support. Documentation/source check; not a new native test. Existing example-specific test claims below retain their stated scope.
Validation scope: Native observations below refer to saved LibreOffice Calc 25.2.3.2 Linux evidence dated 13 October 2026 at 06:04 UTC. This later review checked artifact hashes and all 79 ODS/result pairs, recomputed 47 numerical cases, and separately checked the two tiny subtraction residuals with a relative-only tolerance. Calc was not rerun. Current Help and saved version-specific diagnostics remain distinct.
RAWSUBTRACT subtracts values from left to right while retaining tiny floating-point subtraction residues that ordinary spreadsheet arithmetic may normalize away. It can help audit binary-float artifacts, numeric discrepancies, and calculations where the presence of a tiny difference itself is under investigation. It is not a high-precision decimal-arithmetic engine and cannot create significant digits beyond the precision stored in the inputs.
Quick answer: =RAWSUBTRACT(10;3;2) returns 5. Unlike normal subtraction display behavior in some cases, =RAWSUBTRACT(0.3;0.1;0.2) returned approximately −2.77555756156289E−17 in tested Calc 25.2.3.2, whereas =0.3-0.1-0.2 returned 0 in the same test environment. This is a difference in observed calculation behavior, not a reason to report tiny binary artifacts as meaningful physical measurement.
Syntax and arguments
=RAWSUBTRACT(Minuend;Subtrahend1[;Subtrahend2[;...;Subtrahend254]])
| Argument | Required? | Description | Example |
|---|---|---|---|
Minuend |
Yes | Initial numeric value; subtraction starts here. | A2, 10 |
Subtrahend1 |
Yes | First number to subtract. | B2, 3 |
Subtrahend2 through Subtrahend254 |
No | Up to 253 additional numbers, subtracted sequentially. | C2, 2 |
The official syntax allows up to 255 total arguments (one minuend plus 254 subtrahends), and at least two arguments are required by the documentation. There is no default numeric minuend or subtrahend. Do not deliberately omit a required number, even though a particular older Calc build may tolerate certain empty argument positions.
The examples use Calc’s documented semicolon list separator. A recipient’s locale can change list or decimal separators; look at the Function Wizard in the running installation. The official definition and left-to-right evaluation order come from LibreOffice Help: RAWSUBTRACT, checked 2026-10-13.
First calculation
Set up this simple subtraction table:
| Cell | Value | Role |
|---|---|---|
| A2 | 10 |
Starting balance / minuend |
| B2 | 3 |
First deduction |
| C2 | 2 |
Second deduction |
| D2 | =RAWSUBTRACT(A2;B2;C2) |
Returns 5 |
The literal formula =RAWSUBTRACT(10;3;2) was native-verified as 5. The cell-reference form is the same documented syntax; the native diagnostic =RAWSUBTRACT(K2;L2;M2) with the test cells 10, 3, 2 also returned 5 in Calc 25.2.3.2. Ordinary arithmetic =10-3-2 likewise returns 5: the functions differ most interestingly around small representational residues.
Evaluation order: left to right
RAWSUBTRACT(1;2;3;4) is equivalent in operation order to ((1-2)-3)-4, yielding −8, not 1-(2-3-4) and not 1-2+3+4.
| Formula | Native-verified result | Explanation |
|---|---|---|
=RAWSUBTRACT(10;3;2) |
5 |
Ten minus three minus two. |
=RAWSUBTRACT(1;2;3;4) |
-8 |
Each successive argument subtracts. |
=RAWSUBTRACT(-5;-2;3) |
-6 |
Subtracting -2 adds 2, then subtract 3. |
=RAWSUBTRACT(0;-5) |
5 |
Subtracting a negative increases the result. |
=RAWSUBTRACT(100;25;25;25) |
25 |
Three deductions of 25 from 100. |
=RAWSUBTRACT(0;-0.25;-0.5) |
0.75 |
Double-negative deductions increase the total. |
=RAWSUBTRACT(1000;123.5;234.25;42.125) |
600.125 |
Four-argument decimal scenario. |
These are direct native assertions from LibreOffice Calc 25.2.3.2 with independent left-to-right arithmetic expectations. You can use separate cells if values must be auditable by row or source document.
Why the ‘RAW’ part matters
Computers generally represent spreadsheet numbers with finite binary floating-point precision. Simple decimals such as 0.1 or 0.2 cannot always be represented exactly in that format. When operations combine approximate values, very small residuals can remain.
The following two formulas were both executed in the same native Calc 25.2.3.2 run:
| Formula | Observed Calc output | Interpretation |
|---|---|---|
=RAWSUBTRACT(0.3;0.1;0.2) |
-2.77555756156289E-17 |
Raw binary-float residual remains visible. |
=0.3-0.1-0.2 |
0 |
Ordinary subtraction was normalized/rounded to zero by this version. |
This is not evidence that 0.3 - 0.1 - 0.2 is mathematically nonzero. In exact decimal arithmetic it is zero. The E-17 suffix means the result is around seventeen decimal orders of magnitude smaller than 1; it typically reflects representation and arithmetic rather than meaningful measurement accuracy.
A productive use of RAWSUBTRACT is therefore diagnostic: if a model appears to return zero with normal subtraction, it can help reveal a floating-point residue before deciding whether the residue should be ignored using an appropriate tolerance.
Do not confuse tiny residues with meaningful differences
Suppose a value differs from a target by -2.8E-17. Without additional domain knowledge, this is not a meaningful discrepancy in dollars, measurement units, or transaction balances. A more robust practical check is to compare a difference with a declared tolerance chosen for the domain.
For an independent audit of fixed-cent monetary amounts, do calculations in integer cents when feasible rather than relying on tiny binary residuals. For metrology, preserve original instrument uncertainty and the rules for reporting significant digits. RAWSUBTRACT does neither automatically.
The official fine-precision example — a version-dependent warning
LibreOffice 26.8 Help, checked 2026-10-13, shows the example RAWSUBTRACT(0.987654321098765, 0.9876543210987) with a result 6.53921361504217E-14 (the website’s published punctuation follows its own example formatting). In contrast, when the same two decimal literals were entered with a semicolon separator in native Calc 25.2.3.2 (Linux):
=RAWSUBTRACT(0.987654321098765;0.9876543210987)
Native observed result: 6.50590692430342E-14.
The ordinary subtraction formula with these same decimals, =0.987654321098765-0.9876543210987, also produced 6.50590692430342E-14 in our native test. The difference between the current Help’s reported number and the 25.2.3.2 result is an unresolved documentation/engine/version/rounding discrepancy; it was not attributed to a particular bug without inspecting the corresponding engine implementation and newer releases. Do not copy the website’s example result into a claim about Calc 25.2.3.2 or assert that the website’s result is universal.
If this level of precision is important to your application, reproduce the formula in the exact program version and locale that will evaluate the workbook, and record the stored input values and output format. Recalculation can change cached results when a document is opened with another engine.
Spreadsheet audit example
Assume a reconciliation sheet has an initial inventory balance and several corrections:
| Column | Meaning | Example cell |
|---|---|---|
| A | Initial quantity | A2=100 |
| B | Shipment deducted | B2=25 |
| C | Damaged units deducted | C2=25 |
| D | Final write-off deducted | D2=25 |
| E | Audit residual | =RAWSUBTRACT(A2;B2;C2;D2) |
The corresponding literal case =RAWSUBTRACT(100;25;25;25) returned 25 in native Calc, so the expected row result is 25 when the cell values match. This shows the sequential deduction role, not a practical advantage over an ordinary integer subtraction expression. For a running ledger, a visible sequence of row-by-row balances may be more auditable than a single long formula.
Audit calculated residuals separately
You can put a standard subtraction expression in column F, and RAWSUBTRACT in E, to compare their reported results. A numeric difference of zero in both columns does not prove the original data have exact precision; it only shows both methods reported zero for that case and version.
For tolerance checks, a conceptual, not separately natively tested in this batch formula is:
=IF(ABS(E2)<0.000000000001;"Within tolerance";"Review")
The threshold 1E-12 is only illustrative. Replace it with a justified domain-specific threshold and account for relative scale, measurement uncertainty, and rounding requirements. Never choose one global epsilon without regard to the size and meaning of data.
Advanced examples and limitations
1. Subtract several corrections from a measured starting value
=RAWSUBTRACT(A2;B2;C2;D2) subtracts each correction in order. Use individual numeric cell references; document whether a negative correction is supposed to be subtracted (which adds its magnitude), or whether input data should have been converted to positive deduction amounts first.
2. Test cancellation and small differences
Native Calc returned 0 for =RAWSUBTRACT(0.1;0.1) and −2E-12 for =RAWSUBTRACT(0;1E-12;1E-12). If a result is near zero, inspect at high scientific display precision before concluding it is exactly zero or materially different from zero.
3. Avoid passing a whole range as though it were a list of arguments
This is an especially important behavior found in the native 25.2.3.2 diagnostics. With K2=10, L2=3, and M2=2:
=RAWSUBTRACT(K2;L2;M2)returned 5.=RAWSUBTRACT(K2;L2:M2)returned#VALUE!in this test fixture.
Do not assume that a range is automatically expanded into Subtrahend1;Subtrahend2;.... For many entries, consider a separate auditable calculation with cell-by-cell arguments if the total does not exceed the supported argument limit, or design a sequence/running-balance sheet. This is a native observation, not a cross-version guarantee for every array or range context.
4. Use numeric inputs rather than coercion shortcuts
In the native diagnostic run, RAWSUBTRACT(5;"2") returned 3 and RAWSUBTRACT(5;TRUE()) returned 4, but RAWSUBTRACT(5;"x") failed. Treat those conversions as observed permissive behavior, not as recommended input schema. For imported CSV data, explicitly validate whether fields are genuine numbers and clean them before subtraction.
5. A portable but not perfectly equivalent fallback
When sharing a workbook with software that may not recognize the LibreOffice extension function, the expression =A2-B2-C2 is a broadly familiar substitute for the basic arithmetic but may differ near machine-precision limits. It should be tested in the receiving program, especially if the purpose of the sheet is to expose floating-point residues rather than calculate ordinary balances. Do not claim a byte-for-byte or bit-for-bit substitute for RAWSUBTRACT.
Errors and diagnostic observations
| Native test in Calc 25.2.3.2 | Observed result | Guidance |
|---|---|---|
=RAWSUBTRACT(5) |
Err:511 |
At least two arguments are required in documented usage. |
=RAWSUBTRACT() |
Err:511 |
Provide the minuend and first subtrahend. |
=RAWSUBTRACT(5;) |
5 |
An empty argument happened to be tolerated in this version; not recommended, and does not override official two-argument requirement. |
=RAWSUBTRACT(5;"2") |
3 |
Numeric-looking text was converted in this context; clean imports explicitly. |
=RAWSUBTRACT(5;"x") |
#VALUE! |
Nonnumeric text is not a valid number. |
=RAWSUBTRACT(5;TRUE()) |
4 |
Boolean TRUE behaved numerically as 1 here. |
=RAWSUBTRACT(5;FALSE()) |
5 |
Boolean FALSE behaved numerically as 0 here. |
=RAWSUBTRACT(5;1/0) |
#DIV/0! |
Upstream arithmetic errors propagate. |
=RAWSUBTRACT(5;K5) where K5 has text |
#VALUE! |
A text cell may behave differently from directly typed numeric-looking text. |
=RAWSUBTRACT(5;K6) where K6 is blank |
5 |
Blank reference was effectively zero in this fixture. |
=RAWSUBTRACT(5;K7) where K7=TRUE |
4 |
Boolean cell converted to 1 in this fixture. |
=RAWSUBTRACT(5;K8) where K8 holds text "2" |
3 |
Numeric-looking text cell converted in this fixture. |
=RAWSUBTRACT(K2;L2:M2) |
#VALUE! |
Supplying a range instead of separate scalar arguments did not work in the test. |
There are 20 recorded diagnostics, including simple formula comparisons and additional argument/expression cases; the table focuses on those most useful for troubleshooting. Diagnostic cases were observed, not asserted against a current-version specification. Output strings vary with localization, and the exact Calc error codes may be presented differently in other versions.
How to avoid misleading output
A value that is approximately -2.7756E-17 can be invisible when a cell is formatted with only two or six decimal places. Use scientific format or show sufficient decimal places to diagnose the stored number. Conversely, when preparing a final report, round and compare against domain tolerances explicitly. RAWSUBTRACT is diagnostic arithmetic, not a rule that every residual should be shown as significant.
Some users may expect that ‘RAW’ means exact decimal subtraction. It does not. It exposes arithmetic behavior of finite binary floating-point operands. The original input decimals are themselves subject to storage rounding. For genuinely exact account reconciliation, consider integer smallest-unit accounting or a software system designed for decimal arithmetic where appropriate.
Version and compatibility scope
Official LibreOffice RAWSUBTRACT Help, checked 2026-10-13, says the function is available since LibreOffice 5.2, is not part of OpenDocument OpenFormula 1.3, and uses the namespace ORG.LIBREOFFICE.RAWSUBTRACT. These are documentation statements, not evidence that all possible later application versions and storage formats have identical runtime behavior.
| Environment | Verification and exchange advice |
|---|---|
| LibreOffice Calc 25.2.3.2, Linux | Native execution verified: 22 numeric cases passed independent numerical assertions; 20 separately recorded diagnostics. |
| LibreOffice 5.2 onward | Function-availability claim from official Help; other versions were not executed here. |
| LibreOffice 26.8 Help | Read as documentation on 13 October 2026; 26.8 engine was not tested. |
| Microsoft Excel | Not executed. A LibreOffice-extension function should not be assumed to recalculate unchanged; basic arithmetic alternatives may not preserve fine residuals. |
| Google Sheets | Not executed. Verify parser acceptance and numerical behavior before replacing the extension with ordinary subtraction. |
| Windows/macOS builds | No platform-specific native testing this batch. |
| OpenFormula 1.3 | Official Help labels this function outside that standard and supplies the LibreOffice extension namespace. |
Related functions
Sources, provenance, and editorial verification (13 October 2026)
- Official operation, minimum/maximum arguments, evaluation order, documentation example, introduction in 5.2, OpenFormula 1.3 exclusion, LibreOffice extension namespace: LibreOffice 26.8 Help: RAWSUBTRACT, checked 2026-10-13.
- Native evidence: saved dated results, ODS and calculation script. Results generated on 2026-10-13 with LibreOffice Calc 25.2.3.2, Linux, headless UNO, and compared with independent sequential Python floating-point calculations. Diagnostic observations are separate from numeric passes.