
Returns an identity matrix for the size you specify. This is useful when you need a neutral matrix for testing or matrix setup.
MUNIT returns an identity matrix for the dimension you choose. An identity matrix has 1s on the main diagonal and 0s everywhere else.
This matters because the identity matrix plays the same role in matrix math that the number 1 plays in normal multiplication. When the dimensions match, multiplying a matrix by the identity matrix leaves the original matrix unchanged.
Useful for testing matrix formulas, checking inverses, and building matrix examples.
The result spills to an n by n range based on the dimension you supply.
=MUNIT(dimension)
The dimension must be greater than 0. Microsoft notes that MUNIT returns #VALUE! if the dimension is 0 or negative.
MUNIT does not calculate with an existing matrix. It creates a clean reference matrix that other functions can work with.
| Function | Main job | Returns | Use it when |
|---|---|---|---|
MUNIT |
Creates an identity matrix | An array | You need a neutral matrix of a certain size |
MMULT |
Multiplies matrices | An array | You want to test the identity property or combine matrices |
MINVERSE |
Finds an inverse | An array | You want to compare the product against an identity matrix |
MDETERM |
Finds the determinant | One number | You are checking whether an inverse should exist |
The easiest use is teaching yourself the pattern of an identity matrix. Once you see the diagonal of 1s and the surrounding 0s, it becomes much easier to understand why it behaves like a neutral matrix in multiplication.
It is also useful in real matrix work. After using MINVERSE, you can multiply the original matrix by the inverse with MMULT and compare that result to MUNIT. If the shapes match and the values are close to the identity pattern, the inverse step probably worked. In modern Excel the result spills automatically, while older versions require legacy array entry.
This is the cleanest starting example. The result is a 2x2 grid with 1s on the diagonal.
=MUNIT(2)
Generate a 2x2 identity matrix. Formula: =MUNIT(2).
Changing the dimension changes the whole size of the output because identity matrices are always square.
=MUNIT(3)
Generate a 3x3 identity matrix for testing. Formula: =MUNIT(3).
If the dimensions match, multiplying by the identity matrix gives you the original matrix back.
=MMULT(B2:C3,MUNIT(2))
Multiply B2:C3 by MUNIT(2). The result should be B2:C3. Formula: =MMULT(B2:C3, MUNIT(2)).
Using a cell reference lets you resize the identity matrix without rewriting the formula.
=MUNIT(G2)
Generate an identity matrix based on the dimension in G2. Formula: =MUNIT(G2).
MUNIT creates an identity matrix.MMULT(matrix, MUNIT(n)) should return the original matrix when the sizes match.#VALUE! appears when the dimension is 0 or negative.Tell your friends about this post