Article updated on May 03, 2018

The MUNIT function calculates the identity matrix for a given dimension.

Array formula in cell B2:


The formula above returns an identity matrix with dimension 3, meaning the matrix is 3x3 and has ones on the main diagonal and zeros elsewhere.

Excel Function Syntax



dimension Required. An integer that determines the dimension of the returning unit matrix.


The MUNIT function returns an array, you need to enter the function as an array formula.

To enter an array formula, type the formula in a cell then press and hold CTRL + SHIFT simultaneously, now press Enter once. Release all keys.

The formula bar now shows the formula with a beginning and ending curly bracket telling you that you entered the formula successfully. Don't enter the curly brackets yourself.

The dimension argument must be larger than 0 (zero).

The MUNTI function returns #VALUE if the dimension argument is smaller than or equal to 0 (zero).