MUNIT Function in LibreOffice Calc — Tested Examples
An explanation of LibreOffice Calc MUNIT, including tested formulas, examples, expected results and common mistakes.
Tested: Examples checked in LibreOffice Calc 25.2.3.2. What this means
Returns the unitary square array of a certain size. An identity matrix has ones on the diagonal and zeros everywhere else. The two INDEX expressions inspect specific cells of MUNIT output.
Syntax and arguments
=MUNIT(Dimensions)
LibreOffice Calc formulas generally separate arguments with semicolons (;).
| Argument | Explanation |
|---|---|
Dimensions |
The size of the unitary array. |
Worked examples
Full array output: FILTER, SORT and matrix functions may need a selected output range and Ctrl+Shift+Enter in LibreOffice Calc. The examples below return one scalar result that was tested directly.
Example 1: Return the center diagonal value of an identity matrix
=INDEX(MUNIT(3);2;2)
Expected result: 1. This value was returned in the LibreOffice Calc 25.2 test.
Example 2: Off-diagonal cells of an identity matrix are zero
=INDEX(MUNIT(2);1;2)
Expected result: 0. This value was returned in the LibreOffice Calc 25.2 test.
How to interpret the result
An identity matrix has ones on the diagonal and zeros everywhere else. The two INDEX expressions inspect specific cells of MUNIT output.
Mistakes and troubleshooting
- Check inputs and assumptions: To display the whole matrix instead of one selected element, use a properly sized array-formula output range.
- 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.
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.