MUNIT function

This article describes the formula syntax and usage of the MUNIT function (function: A prewritten formula that takes a value or values, performs an operation, and returns a value or values. Use functions to simplify and shorten formulas on a worksheet, especially those that perform lengthy or complex calculations.) 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.


The workbook below shows examples of this function. Inspect them, change existing formulas, or enter your own formulas to learn how the function works.

To work more in-depth with the example data in Excel, download the embedded workbook to your computer, and then open it in Excel.

Top of Page Top of Page

Applies to:
Excel 2013, Excel Online