MUNIT Function in ONLYOFFICE Spreadsheet Editor: Build Identity Matrices
Create 1x1 to 4x4 identity matrices using MUNIT; exact syntax, array entry, size rules and practical matrix checks.
Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in ONLYOFFICE Spreadsheet Editor. How formula examples are checked
MUNIT constructs an identity (unit) matrix of the specified size: ones along the diagonal and zeros elsewhere. It is an array-valued function that is useful for matrix validation and identity transformations. See ONLYOFFICE’s MUNIT reference.
Exact syntax, argument order and defaults
=MUNIT(dimension)
| Position | Argument | Type and meaning | Default / optional status |
|---|---|---|---|
| 1 | dimension |
Required positive integer giving both row and column count (n×n) | No default; vendor states dimension must be greater than zero. |
No argument is optional, and there is no implied default. For MUNIT, the input is a dimension rather than a source matrix.
Vendor-confirmed: the documented input is a positive integer and the function is an array formula. The official MUNIT page does not give an explicit native error code for zero, negative values, fractional dimensions or text. Such cases are out of the documented domain, but exact error text requires native testing.
Reproducible common matrix dataset
Start with a blank worksheet. Type each entry as a numeric cell (not as quoted text), then place results only in the indicated unused output cells. The sample is deliberately small enough for manual checking.
| Range | Matrix or vector, row by row | Purpose |
|---|---|---|
A2:B3 |
row 2: 2, 1; row 3: 3, 2 |
Invertible 2×2 matrix A (determinant 1). |
D2:E3 |
row 2: 1, 4; row 3: 2, 5 |
Second 2×2 matrix B (determinant −3). |
A6:C8 |
row 6: 1, 2, 3; row 7: 0, 1, 4; row 8: 5, 6, 0 |
Invertible 3×3 matrix C (determinant 1). |
A11:B12 |
row 11: 1, 2; row 12: 2, 4 |
Singular 2×2 matrix S (determinant 0). |
A14:B15 |
row 14: 2, 0; row 15: 0, 3 |
Diagonal 2×2 matrix D (determinant 6). |
J2:J3 |
5 in J2, 8 in J3 |
Right-hand-side vector b. |
Select a blank output area before entering each formula. Never overwrite these input ranges with array-formula results. Use one clean worksheet per guide, or reset your worksheet to this exact baseline before moving between scenarios.
How to enter a matrix result correctly
For multi-cell results, first highlight an appropriately sized blank output rectangle; then enter the formula in the formula bar and use Ctrl+Shift+Enter as explained in the ONLYOFFICE array-formula instructions. The editor adds array braces in the formula bar automatically. If you only press Enter, the vendor’s array guide warns that some functions return the first value rather than filling the requested result range. Always select the exact output shape and compare all cells, not just the upper-left cell. The array guide also says you cannot change only part of an entered array: select the entire array to delete or re-enter it.
Expected results, independently checked (not native execution)
| Output placement | Formula to enter | Expected numerical result | Rationale |
|---|---|---|---|
G2 |
=MUNIT(1) |
[[1]] | 1×1 identity. |
G4:H5 |
=MUNIT(2) |
[[1, 0], [0, 1]] | 2×2 identity. |
G8:I10 |
=MUNIT(3) |
[[1, 0, 0], [0, 1, 0], [0, 0, 1]] | 3×3 identity. |
G13:J16 |
=MUNIT(4) |
4×4, diagonal ones and all other entries zero | Use a 4×4 output range. |
G19:H20 |
=MMULT(A2:B3,MUNIT(2)) |
[[2, 1], [3, 2]] | Advanced verification: multiplying by the 2×2 identity leaves A unchanged; nested array requires native validation. |
G23:H24 |
=MMULT(MUNIT(2),A2:B3) |
[[2, 1], [3, 2]] | Identity works on either side of A mathematically. |
Each displayed matrix is written as rows inside [[...],[...]]. For example [[2,-1],[-3,2]] means output row one 2, -1 and output row two -3, 2; it is not a formula literal to paste into the spreadsheet. Fill the indicated output rectangle using the actual formula, not by typing the expected array. These predictions were calculated with exact rational SymPy mathematics and do not represent measurements from ONLYOFFICE.
Out-of-domain inputs: Try =MUNIT(0), =MUNIT(-2) and =MUNIT(2.5) in a disposable test workbook to record the actual native results; the cited source does not specify an error code for these calls. Make sure the output range you preselect matches the requested positive integer dimension.
Advanced application and reasoning
Multiplying any conformable matrix by an identity matrix of the matching dimension should leave the source matrix unchanged: A×I₂=A and I₂×A=A. Try =MMULT(A2:B3,MUNIT(2)) in a 2×2 result range and separately =MMULT(MUNIT(2),A2:B3). Both have the independent expected matrix [[2,1],[3,2]]. These nested array calls require native verification in the particular ONLYOFFICE edition. MUNIT provides a quick control matrix when checking MINVERSE: MMULT(A,MINVERSE(A)) should resemble MUNIT(2) within numerical tolerance.
Troubleshooting: symptoms versus documented behaviour
| Symptom | Likely cause | Specific action / evidence boundary |
|---|---|---|
Dimension 0, negative, decimal, or text |
Outside the documented positive-integer domain | Change input to 1, 2, 3 etc.; exact native error string not specified by the vendor page. |
| Only a single 1 is visible | Formula entered into one output cell | Select the n×n output range and use Ctrl+Shift+Enter. |
| Wrong output shape or cut-off values | Selected output rectangle does not match n×n | Recreate the array with a properly sized target. |
| Formula cannot be edited cell by cell | Array range is protected as a group | Select the whole array before editing, as official help instructs. |
Related ONLYOFFICE functions and verified links
- MMULT — related matrix operation, with its own documented signature and error conditions.
- MINVERSE — related matrix operation, with its own documented signature and error conditions.
- MDETERM — related matrix operation, with its own documented signature and error conditions.
- Function entry and argument-picker instructions.
- Array formula entry and array editing.
- Formula language and regional settings.
Verification and compatibility
This guide is based on the current, unversioned English ONLYOFFICE help pages on 2026-10-13 (UTC) and independent numerical reasoning. The sample values below are expected values, not results observed in a running ONLYOFFICE Spreadsheet Editor. No screenshot, workbook execution, web edition test, Desktop edition test, or historic version support test was performed. Use the official function catalogue.
Edition and compatibility: ONLYOFFICE’s documentation describes the current Docs Spreadsheet Editor; its Desktop changelog and Docs changelog are distinct records. None of the cited function pages establishes a first-supported Desktop or web version for this function; do not infer universal historical compatibility or claim that an XLSX exported to another spreadsheet program evaluates identically. Where a function returns an array, the current ONLYOFFICE array-entry guide explicitly describes selecting the complete output range, entering the formula and pressing Ctrl+Shift+Enter. Do not manually type the surrounding { }. In some editions, dynamic-array behaviour may differ and must be tested.
Formula language and separators: The examples use English names, A1-style references, a decimal point, and commas between arguments. The official function-entry guide shows these conventions. The Advanced Settings guide documents configurable formula language, region and numeric separators; it does not provide a verified translation or formula argument separator for every locale. Change regional settings as appropriate and verify the resulting formula entry in the target edition rather than blindly substituting commas with semicolons.
Official evidence checked on 2026-10-13 (UTC)
| Specific claim | ONLYOFFICE official reference | Validation status |
|---|---|---|
| Purpose, exact function syntax and required arguments | MUNIT reference | Documentation checked; no app run |
| Input errors, argument shape/domain and array declaration, where given | MUNIT reference | Only vendor-stated cases are called native errors |
| Select output range and use Ctrl+Shift+Enter for multi-cell array output | Inserting array formulas | Documentation checked |
| Enter names, arguments and ranges as spreadsheet formulas | Inserting functions | Documentation checked |
| Locale and formula-language settings | Advanced settings | Documentation checked; exact translations not inferred |
| Desktop vs Docs/web historical support | Desktop changelog and Docs changelog | A first-supported release is not established by these checks |
| All numeric examples | Independent exact-rational mathematical calculation | Expected, not native ONLYOFFICE output |