MUNIT function

This article describes the formula syntax and usage of the MUNIT function in Microsoft 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.

Example

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.

Formula

Description

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

'=MUNIT(3)

Returns the identity matrix of dimension 3.

=MUNIT(3)

=MUNIT(3)

=MUNIT(3)

=MUNIT(3)

=MUNIT(3)

=MUNIT(3)

=MUNIT(3)

=MUNIT(3)

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

Applies To: Excel 2016 Preview, Excel 2013, Excel Online, Excel 2016 for Mac, Excel for Mac 2011



Was this information helpful?

Yes No

How can we improve it?

255 characters remaining

To protect your privacy, please do not include contact information in your feedback. Review our privacy policy.

Thank you for your feedback!

Support resources

Change language