MUNIT Function
MUNIT Function

MUNIT Function

Returns an identity matrix for the size you specify. This is useful when you need a neutral matrix for testing or matrix setup.

ExcelClash Team
Published

Summary

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.

Purpose

Create an identity matrix

Useful for testing matrix formulas, checking inverses, and building matrix examples.

Return Value

A square array

The result spills to an n by n range based on the dimension you supply.

Syntax

=MUNIT(dimension)

The dimension must be greater than 0. Microsoft notes that MUNIT returns #VALUE! if the dimension is 0 or negative.

Arguments

  • dimension - Required. A positive integer that sets both the row count and the column count.

MUNIT vs Other Matrix Functions

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

Using MUNIT

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.

Example 1 - Generate a 2x2 identity matrix

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)
Check Answer
Challenge #1
Target: Sheet1!D2

In cell D2, generate a 2x2 identity matrix.

Example 2 - Generate a 3x3 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)
Check Answer
Challenge #2
Target: Sheet1!D5

In cell D5, generate a 3x3 identity matrix.

Example 3 - Show that identity leaves a matrix unchanged

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))
Check Answer
Challenge #3
Target: Sheet1!D8

In cell D8, multiply the matrix in B8:C9 by MUNIT(2).

Example 4 - Make the size dynamic

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)
Check Answer
Challenge #4
Target: Sheet1!D11

In cell D11, generate an identity matrix using the dimension in G2.

Conclusion Recap

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.

  • Main job: MUNIT creates an identity matrix.
  • Pattern: 1s on the main diagonal and 0s elsewhere.
  • Input rule: The dimension must be a positive number.
  • Useful check: MMULT(matrix, MUNIT(n)) should return the original matrix when the sizes match.
  • Common error: #VALUE! appears when the dimension is 0 or negative.
Tactical Arena
Share MUNIT Function!

Tell your friends about this post

Discussion

ExcelClash is an interactive platform designed to level up your Excel skills through real-world exercises and challenges. Sharpen your logic, solve real spreadsheet problems, and learn faster.

© 2026 ExcelClash, Inc. All rights reserved.