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.
Syntax
| Argument | Description | |
|---|---|---|
dimension | Required | A 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.
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
Pick a MUNIT example to see the formula and its result.
Practice workbook
Frequently asked questions
What is an identity matrix?
What argument does MUNIT take?
=MUNIT(3) returns a 3×3 identity matrix; =MUNIT(2) returns a 2×2.Which Excel versions have MUNIT?
What is MUNIT used for?
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