
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.
MUNIT is a support function for matrix work. It creates an identity matrix quickly, which is useful in demonstrations, testing, and formulas where a standard matrix structure is needed as a reference point for broader linear algebra operations.
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.
This helps the learner see the identity pattern quickly. Once that diagonal-of-1s shape is familiar, the purpose of MUNIT is much easier to remember.
=MUNIT(2)
In cell D2, generate a 2x2 identity matrix.
Changing the dimension changes the whole size of the output because identity matrices are always square.
This is useful because it shows that the single input controls the full output size. A bigger dimension creates a bigger square identity matrix automatically.
=MUNIT(3)
In cell D5, generate a 3x3 identity matrix.
If the dimensions match, multiplying by the identity matrix gives you the original matrix back.
This is the key practical meaning of the identity matrix. The example shows why MUNIT matters in matrix math instead of being only a visual pattern.
=MMULT(B2:C3,MUNIT(2))
In cell D8, multiply the matrix in B8:C9 by MUNIT(2).
Using a cell reference lets you resize the identity matrix without rewriting the formula.
This is practical in demos and models where the matrix size may change. The identity matrix can then grow or shrink with the input cell.
=MUNIT(G2)
In cell D11, generate an identity matrix using the dimension in G2.
MUNIT is the function that builds the identity matrix for you, so the main lesson here was understanding that pattern of 1s on the diagonal and 0s everywhere else. Once that pattern makes sense, the purpose of the function becomes much easier to remember.
The examples also showed why it matters in matrix work. You can use MUNIT as a clean reference, compare it with inverse results, and prove that multiplying by the identity matrix leaves another matrix unchanged. That makes it a simple but very useful support function.
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