MDETERM Function in LibreOffice Calc — Tested Examples
Calculate square-matrix determinants in LibreOffice Calc. Preserve tested2x2 fixtures, add a3x3 control and diagnose nonsquare, nonnumeric and near-singular inputs.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: MDETERM returns one scalar determinant from a square numeric matrix. A zero determinant can be a valid singular-matrix result.
Availability and version history
- Introduced: Documented by LibreOffice 26.8.1.1; original introduction not established.
- 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.
Returns the array determinant. For the matrix with rows [2,1] and [1,3], the determinant is 2×3−1×1=5.
Syntax and arguments
=MDETERM(Array)
LibreOffice Calc formulas generally separate arguments with semicolons (;).
| Argument | Explanation |
|---|---|
Array |
Required square numeric array or cell range, with equal row and column counts. |
Worked examples
Reproduce these source cells: Q10=2, R10=1, Q11=1, R11=3. The second test uses Q13=1, R13=2, Q14=3, R14=4.
Example 1: Calculate the determinant of a 2x2 matrix
=MDETERM(Q10:R11)
Expected result: 5. This value was returned in the LibreOffice Calc 25.2 test.
Example 2: Determinant of a different 2 by 2 matrix
=MDETERM(Q13:R14)
Expected result: -2. This value was returned in the LibreOffice Calc 25.2 test.
How to interpret the result
For the matrix with rows [2,1] and [1,3], the determinant is 2×3−1×1=5.
Mistakes and troubleshooting
- Check inputs and assumptions: The input must be square. A determinant of 0 can be mathematically valid and means the matrix is singular.
- Check argument order and format: Strings go in quotes, cell references do not. Functions that return arrays may require special entry.
- Verify your own data: Reproduce the example first. If your formula returns an error, inspect the referenced cells and individual argument values.
Additional worked application and edge cases
Matrix input and scalar output
The argument is one square numeric array: the number of rows must equal the number of columns. A rectangular range is not made square by selecting a square output area. LibreOffice Help confirms that MDETERM returns one value in the current cell; you do not need a multi-cell result selection.
The inspected Calc implementation rejects a nonnumeric matrix and nonsquare or zero-size dimensions. Prepare explicit numeric entries, including explicit zeros where the mathematical matrix has zeros. Do not assume that labels, numeric text or missing measurements are valid matrix elements.
Stepwise example: a3x3 matrix
Put this dataset in A2:C4:
| Row | A | B | C |
|---|---|---|---|
| 2 | 2 | 1 | 0 |
| 3 | 0 | 3 | 1 |
| 4 | 1 | 0 | 4 |
Enter =MDETERM(A2:C4) in E2. The independently expected determinant is 25. Expansion along the first row gives 2×(3×4−1×0)−1×(0×4−1×1)+0 =24+1=25.
Keep the existing Q10:R11 and Q13:R14 examples unchanged when reproducing their historical tests. This new A2:C4 fixture is separately calculated and has not been run in Calc for this update.
Second example: intentionally singular data
In G2:I4 enter rows [1,2,3], [2,4,6] and [0,1,1]. =MDETERM(G2:I4) is mathematically 0 because the second row is exactly twice the first. Zero is a valid result for this matrix, not an error to suppress.
A singular matrix has no ordinary inverse. Conversely, a nonzero mathematical determinant establishes invertibility, but it does not prove that a numerical inversion will be well-conditioned.
Advanced application: compare a row swap
Swap the first two rows of the A2:C4 matrix into a separate3x3 range. The determinant should change from25 to -25. Multiplying one row by2 instead should multiply the determinant by2, giving 50. These are useful controls for a range-reference or row-order mistake.
A determinant’s magnitude depends on scaling. Comparing raw determinants from differently scaled matrices is not a reliable condition-number test. Keep units and scaling visible when the matrix represents physical quantities.
Near-singular precision and errors
The mathematical2x2 matrix with rows[1,1] and[1,1+10^-12] has determinant 10^-12. Floating-point storage and subtraction can make the calculated result differ in its last digits. An exact comparison to zero is therefore not a universal numerical singularity test for measured or nearly dependent data.
Use tolerances and conditioning checks appropriate to the matrix’s scale, rather than automatically rounding every small determinant to zero. Increasing displayed decimal places cannot restore precision that has already been lost in the inputs.
For a formula error, check dimensions, text/error cells, range references and available matrix size. The inspected implementation uses LUP decomposition and applies a singularity check; the hand expansion above is an independent control, not a claim about Calc’s internal algorithm or every error’s displayed code.
- Pinned Calc determinant implementation, inspected October17,2026, source review only.
Verification scope for this addition: These added results were independently calculated or derived from the cited documentation/source. They were not newly tested in LibreOffice Calc. The original example-specific Calc 25.2.3.2 claims elsewhere on this page remain historical and apply only to those original examples. The cited 26.8.1.1 source tag is a code reference, not a claim of a new run in that release.
Related functions
Tested version and primary reference
2 example(s) on this page passed real calculations in LibreOffice Calc 25.2.3.2. This is not a claim about every possible input or other spreadsheet applications.