MUNIT function

The MUNIT function returns a unit matrix of size dimension x dimension. The result of this function is an array of form:

1 0 …  0

0 1 ... 0 

0 0 … ...

0 0 … 1

Parts of a MUNIT function


Part Description
dimension Required. The size of the unit matrix. Dimension must be an integer greater than zero.

Sample formulas

Example 1:  MUNIT(1)

Example 2: MUNIT(3)


If dimension is less than 1, MUNIT returns a #VALUE error.


Result for A1=MUNIT(1)

1 1

Result for A1= MUNIT(3)

  A B C
1 1 0 0
2 0 1 0
3 0 0 1

Related functions

  • MMULT: Calculates the matrix product of two matrices specified as arrays or ranges.
  • RANDARRAY: The RANDARRAY function generates an array of random numbers between 0 and 1.
Visit the Learning Center

Using Google products, like Google Docs, at work or school? Try powerful tips, tutorials, and templates. Learn to work on Office files without installing Office, create dynamic project plans and team calendars, auto-organize your inbox, and more.

Clear search
Close search
Google apps
Main menu