MUNIT function

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

Description

Returns the unit matrix for the specified dimension.

Syntax

MUNIT(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

Remarks

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

Examples

The following example shows the results of the MUNIT function in a 3X3 matrix below, in cells A1:C3. To return a 3x3 matrix, the formula in C2:E4 needs to be entered as an array by pressing Ctrl+Shift+Enter.

Note: If you have a current version of Office 365, then you can simply enter the formula in the top left-cell of the output range and then press ENTER to confirm the formula as a dynamic array formula. Otherwise, the formula must be entered as a legacy array formula by first selecting the output range, entering the formula in the top-left-cell of the output range, and then pressing CTRL+SHIFT+ENTER to confirm it. Excel inserts curly brackets at the beginning and end of the formula for you. For more information on array formulas, see Guidelines and examples of array formulas.

An example of MUNIT function

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

An example of MUNIT function

Need more help?

You can always ask an expert in the Excel Tech Community, get support in the Answers community, or suggest a new feature or improvement on Excel User Voice.

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.

×