The MUNIT function returns the unit matrix for the specified dimension.

  • This function was introduced in Excel 2013 and so is not available in earlier versions.




Argument Description
dimension An integer specifying the dimension of the unit matrix that you want to return

  dimension must be greater than 0 

Inputting Array Formulas: To input an array formula,

  1. highlight the range of cells for the function result, 
  2. type the function into the first cell of the range, and


  A B C D E
1 Formula Result Notes
2 {=MUNIT(3)} 1 0 0 Returns the identity matrix of dimension 3
3   0 1 0  
4   0 0 1  

Note: The formula displayed in A2 is an array formula entered by following the instructions above for entering an array formula. The curly brackets, { and }, are not entered by the user. Excel applies these to show the formula has been input as an array formula.

Common Function Error(s)

Problem What went wrong
#VALUE! Occurs if either:

  the dimension argument is less than or equal to zero
  the dimension argument is not recognized as a numeric value
#N/A Occurs in cells outside the range of the resulting matrix, e.g. in the example above, had we highlighted cells F7-H10 before entering the MINVERSE function, cells, F10-H10 are not part of the resulting matrix and therefore will return the #N/A error

MUNIT uses the following equation:  

    \[    1_{n \times n} = \left[ \begin{array}{cccc}1 & 0 & \dots & 0  \\0 & 1 & \dots & 0  \\\vdots & \vdots & \ddots & \vdots  \\0 & 0 & \dots & 1  \end{array} \right]    \]