MUNIT
Quirk foundCategory: Math and trigonometry · Last tested 2026-09-01
Real compatibility results for the MUNIT function: executed in Excel for the web, Google Sheets and LibreOffice Calc, with desktop Excel behavior from Microsoft’s official documentation (we do not run desktop Excel — Excel for the web is a different application and is executed separately). Syntax and links to that documentation are below.
Support matrix
| Engine | Documented | Live-tested | Verdict |
|---|---|---|---|
| Excel (desktop) | Yes | No — documented only | n/a |
| Excel for the web | — | Yes (recalc, 2026-09-01) | Supported, behaves as documented |
| Google Sheets | Yes | Yes (Drive import, 2026-08-31) | Quirk found |
| LibreOffice Calc | Yes | Yes (25.8.7.3, 2026-08-31) | Supported, behaves as documented |
LibreOffice version history
We executed the same test cases under each LibreOffice release to show exactly when MUNIT’s support changed — not documentation claims, real results.
| LibreOffice version | Verdict | Tested |
|---|---|---|
| 24.2.0.3 | Supported, behaves as documented | 2026-08-31 |
| 24.8.7.2 | Supported, behaves as documented | 2026-08-31 |
| 25.2.0.3 | Supported, behaves as documented | 2026-08-31 |
| 25.8.7.3 | Supported, behaves as documented | 2026-08-31 |
Why isn’t MUNIT working in Google Sheets?
MUNIT runs in Google Sheets, but our executed cases show it does not match
Excel’s documented behavior on every input (the failing cases are listed on this page). If a
formula that behaves one way in Excel gives you a different answer in Sheets, compare your usage
against those cases before assuming your data is wrong.
Discovered quirks
-
=MUNIT(0) on
Google Sheets returned
#NUM!, but the documented/expected
result is #VALUE!.
Provenance
Microsoft documents: "If dimension is a value that's equal to or smaller than zero (0), MUNIT returns the #VALUE! error value", and separately "The dimension has to be greater than zero." OpenFormula 1.3 section 6.5.5 states the same constraint ("The dimension has to be greater than zero"). Zero is the boundary the words "equal to" include. Note this family uses #VALUE! rather than the #NUM! that most out-of-range numeric arguments produce elsewhere in Excel, which is exactly why it is worth asserting.; MISMATCH vs expected: expected '#VALUE!', got '#NUM!'
-
=MUNIT(-1) on
Google Sheets returned
#NUM!, but the documented/expected
result is #VALUE!.
Provenance
The same documented clause -- "equal to or smaller than zero (0)" -- exercised below the boundary rather than on it. Asserted separately because an engine can guard the equality and not the inequality.; MISMATCH vs expected: expected '#VALUE!', got '#NUM!'
Executed test cases
Excel for the web (executed 2026-09-01 via OneDrive recalculation)
These values come from Excel for the web, not from desktop Excel. They are two different implementations of the calculation engine, and this run measured only the web one: the corpus was uploaded to OneDrive as .xlsx, recalculated by Excel for the web on open, and downloaded again for readback. Excel for the web is a rolling service with no pinnable version, so the run is identified by its date. Where a value here disagrees with the Expected column — which is Microsoft’s documentation of the desktop product — we cannot tell you whether the web engine diverges from the desktop one or the documentation is wrong about both, because we do not run desktop Excel.
| Formula | Description | Result | Expected | Verdict |
|---|---|---|---|---|
| =MUNIT(3) | The documented 3x3 unit matrix, entered as a legacy array formula | {1, 0, 0, 0, 1, 0, 0, 0, 1} | {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}ProvenanceMicrosoft documents MUNIT as returning "the unit matrix for the specified dimension" and illustrates exactly this case: "The following example shows the results of the MUNIT function in a 3X3 matrix below, in cells A1:C3." DERIVATION: the unit (identity) matrix is fixed by its definition, not by any implementation -- entry (i,j) is 1 when i = j and 0 otherwise -- so the whole 3x3 answer is forced and no arithmetic is involved. ENTERED AS AN ARRAY FORMULA, because the page is explicit that outside dynamic-array Excel "the formula must be entered as a legacy array formula by first selecting the output range (A1:C3 in this case), entering the formula in the top-left-cell of the output range, and then pressing CTRL+SHIFT+ENTER"; the harness therefore writes it as a CSE array formula over the full 3x3 check range, exactly as it does for MMULT and MINVERSE. Microsoft's page was re-read live on 2026-08-31 at https://support.microsoft.com/en-us/excel/functions/munit-function -- note the path: the older /en-us/office/<name>-function-<guid> URLs were returning Microsoft's 'Sorry, the page you're looking for can't be found' body all through this batch (confirmed with curl, with the r.jina.ai reader and with a real headless Firefox), while the /en-us/excel/functions/<name>-function path serves the same article intermittently -- roughly one request in two returns an 87 KB stub, so every page cited in this batch was fetched with retries until the payload exceeded 150 KB. |
Matched |
| =INDEX(MUNIT(4),3,3) | A diagonal entry of a 4x4 unit matrix, read out with INDEX so the result is scalar | 1 | 1ProvenanceReading one cell out of the array with INDEX turns a spill result into a scalar, which removes the array-entry question from this assertion entirely: whatever the engine does about spilling, entry (3,3) of a unit matrix is 1 by definition. The dimension is deliberately 4 rather than the documented 3, so this case fails if an engine ignores its argument and always returns a 3x3 matrix. |
Matched |
| =INDEX(MUNIT(4),3,2) | An off-diagonal entry of the same 4x4 unit matrix | 0 | 0ProvenanceThe other half of the definition: entry (3,2) is off the diagonal and is 0. Asserted separately from the diagonal case because an engine that returned a matrix of all ones would satisfy the diagonal assertion on its own. |
Matched |
| =INDEX(MMULT(A2:B3,MUNIT(2)),2,1) | Multiplying a matrix by MUNIT(2) must return the operand unchanged | 7 | 7ProvenanceMicrosoft's own closing remark is that "MUNIT can be used in line with other matrix functions, such as MMULT", and this is that claim made checkable. The unit matrix is the multiplicative identity of matrix multiplication, so {1,3; 7,2} x MUNIT(2) = {1,3; 7,2} and the entry at row 2 column 1 is 7 -- exactly and structurally, with no derived constant anywhere. An engine whose MUNIT is transposed, mis-sized or filled with the wrong constant cannot return 7 here by accident. MMULT itself was executed by batch E of this corpus and is supported on all four LibreOffice builds, so a failure here is MUNIT's. |
Matched |
| =MUNIT(0) | A dimension of zero, which the page excludes | #VALUE! | #VALUE!ProvenanceMicrosoft documents: "If dimension is a value that's equal to or smaller than zero (0), MUNIT returns the #VALUE! error value", and separately "The dimension has to be greater than zero." OpenFormula 1.3 section 6.5.5 states the same constraint ("The dimension has to be greater than zero"). Zero is the boundary the words "equal to" include. Note this family uses #VALUE! rather than the #NUM! that most out-of-range numeric arguments produce elsewhere in Excel, which is exactly why it is worth asserting. |
Matched |
| =MUNIT(-1) | A negative dimension, the other half of the same documented exclusion | #VALUE! | #VALUE!ProvenanceThe same documented clause -- "equal to or smaller than zero (0)" -- exercised below the boundary rather than on it. Asserted separately because an engine can guard the equality and not the inequality. |
Matched |
Google Sheets (executed 2026-08-31 via Drive import)
Google Sheets is a rolling service with no pinnable version, so this run is identified by its date. The corpus was imported to Drive as .xlsx, recalculated by Sheets, and exported back for readback.
| Formula | Description | Result | Expected | Verdict |
|---|---|---|---|---|
| =MUNIT(3) | The documented 3x3 unit matrix, entered as a legacy array formula | {1, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0} | {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}ProvenanceMicrosoft documents MUNIT as returning "the unit matrix for the specified dimension" and illustrates exactly this case: "The following example shows the results of the MUNIT function in a 3X3 matrix below, in cells A1:C3." DERIVATION: the unit (identity) matrix is fixed by its definition, not by any implementation -- entry (i,j) is 1 when i = j and 0 otherwise -- so the whole 3x3 answer is forced and no arithmetic is involved. ENTERED AS AN ARRAY FORMULA, because the page is explicit that outside dynamic-array Excel "the formula must be entered as a legacy array formula by first selecting the output range (A1:C3 in this case), entering the formula in the top-left-cell of the output range, and then pressing CTRL+SHIFT+ENTER"; the harness therefore writes it as a CSE array formula over the full 3x3 check range, exactly as it does for MMULT and MINVERSE. Microsoft's page was re-read live on 2026-08-31 at https://support.microsoft.com/en-us/excel/functions/munit-function -- note the path: the older /en-us/office/<name>-function-<guid> URLs were returning Microsoft's 'Sorry, the page you're looking for can't be found' body all through this batch (confirmed with curl, with the r.jina.ai reader and with a real headless Firefox), while the /en-us/excel/functions/<name>-function path serves the same article intermittently -- roughly one request in two returns an 87 KB stub, so every page cited in this batch was fetched with retries until the payload exceeded 150 KB. |
Matched |
| =INDEX(MUNIT(4),3,3) | A diagonal entry of a 4x4 unit matrix, read out with INDEX so the result is scalar | 1 | 1ProvenanceReading one cell out of the array with INDEX turns a spill result into a scalar, which removes the array-entry question from this assertion entirely: whatever the engine does about spilling, entry (3,3) of a unit matrix is 1 by definition. The dimension is deliberately 4 rather than the documented 3, so this case fails if an engine ignores its argument and always returns a 3x3 matrix. |
Matched |
| =INDEX(MUNIT(4),3,2) | An off-diagonal entry of the same 4x4 unit matrix | 0 | 0ProvenanceThe other half of the definition: entry (3,2) is off the diagonal and is 0. Asserted separately from the diagonal case because an engine that returned a matrix of all ones would satisfy the diagonal assertion on its own. |
Matched |
| =INDEX(MMULT(A2:B3,MUNIT(2)),2,1) | Multiplying a matrix by MUNIT(2) must return the operand unchanged | 7 | 7ProvenanceMicrosoft's own closing remark is that "MUNIT can be used in line with other matrix functions, such as MMULT", and this is that claim made checkable. The unit matrix is the multiplicative identity of matrix multiplication, so {1,3; 7,2} x MUNIT(2) = {1,3; 7,2} and the entry at row 2 column 1 is 7 -- exactly and structurally, with no derived constant anywhere. An engine whose MUNIT is transposed, mis-sized or filled with the wrong constant cannot return 7 here by accident. MMULT itself was executed by batch E of this corpus and is supported on all four LibreOffice builds, so a failure here is MUNIT's. |
Matched |
| =MUNIT(0) | A dimension of zero, which the page excludes | #NUM! | #VALUE!ProvenanceMicrosoft documents: "If dimension is a value that's equal to or smaller than zero (0), MUNIT returns the #VALUE! error value", and separately "The dimension has to be greater than zero." OpenFormula 1.3 section 6.5.5 states the same constraint ("The dimension has to be greater than zero"). Zero is the boundary the words "equal to" include. Note this family uses #VALUE! rather than the #NUM! that most out-of-range numeric arguments produce elsewhere in Excel, which is exactly why it is worth asserting. |
Mismatch |
| =MUNIT(-1) | A negative dimension, the other half of the same documented exclusion | #NUM! | #VALUE!ProvenanceThe same documented clause -- "equal to or smaller than zero (0)" -- exercised below the boundary rather than on it. Asserted separately because an engine can guard the equality and not the inequality. |
Mismatch |
LibreOffice Calc 25.8.7.3 (tested 2026-08-31)
| Formula | Description | Result | Expected | Verdict |
|---|---|---|---|---|
| =MUNIT(3) | The documented 3x3 unit matrix, entered as a legacy array formula | {1, 0, 0, 0, 1, 0, 0, 0, 1} | {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}ProvenanceMicrosoft documents MUNIT as returning "the unit matrix for the specified dimension" and illustrates exactly this case: "The following example shows the results of the MUNIT function in a 3X3 matrix below, in cells A1:C3." DERIVATION: the unit (identity) matrix is fixed by its definition, not by any implementation -- entry (i,j) is 1 when i = j and 0 otherwise -- so the whole 3x3 answer is forced and no arithmetic is involved. ENTERED AS AN ARRAY FORMULA, because the page is explicit that outside dynamic-array Excel "the formula must be entered as a legacy array formula by first selecting the output range (A1:C3 in this case), entering the formula in the top-left-cell of the output range, and then pressing CTRL+SHIFT+ENTER"; the harness therefore writes it as a CSE array formula over the full 3x3 check range, exactly as it does for MMULT and MINVERSE. Microsoft's page was re-read live on 2026-08-31 at https://support.microsoft.com/en-us/excel/functions/munit-function -- note the path: the older /en-us/office/<name>-function-<guid> URLs were returning Microsoft's 'Sorry, the page you're looking for can't be found' body all through this batch (confirmed with curl, with the r.jina.ai reader and with a real headless Firefox), while the /en-us/excel/functions/<name>-function path serves the same article intermittently -- roughly one request in two returns an 87 KB stub, so every page cited in this batch was fetched with retries until the payload exceeded 150 KB. |
Matched |
| =INDEX(MUNIT(4),3,3) | A diagonal entry of a 4x4 unit matrix, read out with INDEX so the result is scalar | 1 | 1ProvenanceReading one cell out of the array with INDEX turns a spill result into a scalar, which removes the array-entry question from this assertion entirely: whatever the engine does about spilling, entry (3,3) of a unit matrix is 1 by definition. The dimension is deliberately 4 rather than the documented 3, so this case fails if an engine ignores its argument and always returns a 3x3 matrix. |
Matched |
| =INDEX(MUNIT(4),3,2) | An off-diagonal entry of the same 4x4 unit matrix | 0 | 0ProvenanceThe other half of the definition: entry (3,2) is off the diagonal and is 0. Asserted separately from the diagonal case because an engine that returned a matrix of all ones would satisfy the diagonal assertion on its own. |
Matched |
| =INDEX(MMULT(A2:B3,MUNIT(2)),2,1) | Multiplying a matrix by MUNIT(2) must return the operand unchanged | 7 | 7ProvenanceMicrosoft's own closing remark is that "MUNIT can be used in line with other matrix functions, such as MMULT", and this is that claim made checkable. The unit matrix is the multiplicative identity of matrix multiplication, so {1,3; 7,2} x MUNIT(2) = {1,3; 7,2} and the entry at row 2 column 1 is 7 -- exactly and structurally, with no derived constant anywhere. An engine whose MUNIT is transposed, mis-sized or filled with the wrong constant cannot return 7 here by accident. MMULT itself was executed by batch E of this corpus and is supported on all four LibreOffice builds, so a failure here is MUNIT's. |
Matched |
| =MUNIT(0) | A dimension of zero, which the page excludes | #VALUE! | #VALUE!ProvenanceMicrosoft documents: "If dimension is a value that's equal to or smaller than zero (0), MUNIT returns the #VALUE! error value", and separately "The dimension has to be greater than zero." OpenFormula 1.3 section 6.5.5 states the same constraint ("The dimension has to be greater than zero"). Zero is the boundary the words "equal to" include. Note this family uses #VALUE! rather than the #NUM! that most out-of-range numeric arguments produce elsewhere in Excel, which is exactly why it is worth asserting. |
Matched |
| =MUNIT(-1) | A negative dimension, the other half of the same documented exclusion | #VALUE! | #VALUE!ProvenanceThe same documented clause -- "equal to or smaller than zero (0)" -- exercised below the boundary rather than on it. Asserted separately because an engine can guard the equality and not the inequality. |
Matched |
Docs & syntax
- Excel (desktop): official documentation
- Google Sheets: official documentation
- LibreOffice Calc: official documentation
Where MUNIT behaves differently
- Your function exists but your file cannot say so: _xlfn storage tokens
Executed: eight IM* functions LibreOffice implements return #NAME? on all four builds because it cannot read Excel's _xlfn. token for them, while COT and CSC only work under that same prefix. Eleven LibreOffice aliases are erased by its own exporter, and a token change between 24.2 and 24.8 makes a 24.8-written file open as #NAME? in 24.2.