MUNIT function

This article describes the formula syntax and usage of the MUNIT function in Microsoft Excel.


Returns the unit matrix for the specified dimension.



The MUNIT function syntax has the following arguments.

Dimension    Required. Dimension is an integer specifying the dimension of the unit matrix that you want to return. It returns an array. The dimension has to be greater than zero.

MUNIT uses the following equation:

Munit equation


  • If dimension is a value that’s equal to or smaller than zero (0), MUNIT returns the #VALUE! error value.


Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.



Results are the 3x3 matrix below, in cells C2:E4.


Returns the identity matrix of dimension 3.










'=MMULT({1,3;5,12}, MUNIT(2))={1,3;5,12}

MUNIT can be used in line with other matrix functions, such as MMULT, as shown here.

=MMULT({1,3;5,12}, MUNIT(2))={1,3;5,12}

Note: To return a 3x3 matrix, the formula in C2:E4 needs to be entered as an array by pressing Ctrl+Shift+Enter.

Top of Page

Expand your Office skills
Explore training
Get new features first
Join Office Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.