MUNIT Function

Excel Functions › Math & Trig

Excel 2013+ Math & Trig

The Excel MUNIT function returns the identity matrix of a given size — a square array with 1s on the main diagonal and 0s everywhere else. It is the matrix equivalent of the number 1.


Quick answer:
=MUNIT(3) 3×3 identity spills as {1,0,0;0,1,0;0,0,1}

Syntax

=MUNIT(dimension)
ArgumentDescription
dimensionRequiredA positive whole number giving the size of the square identity matrix to return (dimension × dimension).

How to use it

MUNIT builds an n×n identity matrix and spills it across cells. The identity is the multiplicative identity for matrices: any matrix multiplied by an identity of the right size is unchanged.

=MUNIT(3) // {1,0,0;0,1,0;0,0,1}

It is handy for testing inverses (MMULT(A, MINVERSE(A)) should equal MUNIT(n)) and as a starting point for building scaling or transformation matrices.

Excel 2013 and later. MUNIT was introduced in Excel 2013. In Excel 365 it spills automatically; in 2013-2019 enter it as an array with Ctrl+Shift+Enter across an n×n range.

Try it: interactive demo

Live demo

Pick a MUNIT example to see the formula and its result.

Result:

Practice workbook

📊
Download the free MUNIT practice workbook
Every example on this page, ready to open in Excel — plus practice challenges with answers on a separate tab. No sign-up required.

Frequently asked questions

What is an identity matrix?
A square matrix with 1s on the main diagonal and 0s everywhere else. Multiplying any compatible matrix by the identity leaves it unchanged, just like multiplying a number by 1.
What argument does MUNIT take?
A single positive whole number, the dimension. =MUNIT(3) returns a 3×3 identity matrix; =MUNIT(2) returns a 2×2.
Which Excel versions have MUNIT?
MUNIT was added in Excel 2013, so it is available in 2013, 2016, 2019, 2021, and Microsoft 365. It is not in Excel 2010 or earlier.
What is MUNIT used for?
Verifying inverses (a matrix times its inverse equals the identity), seeding transformation matrices, and as a neutral element in matrix calculations.

Master functions like this in one day

This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related functions: MMULT · MINVERSE · MDETERM · SEQUENCE · TRANSPOSE