# MUNIT Function

> Create an identity matrix of a given size with the MUNIT formula function of TX Sheet Control: a spilled square range, the #VALUE! error and an example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Function
- **Path:** TX Sheet Control > API Reference > Formula Functions > MUNIT Function
- **185 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/munit/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/munit/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/munit/llms-full.txt

---

Return the identity matrix of a given dimension. `array_or_dimension` is the number of rows and columns; the matrix has 1 on its diagonal and 0 everywhere else and spills into a square range. A dimension less than 1 returns `#VALUE!`.

### Syntax

```text
MUNIT(array_or_dimension, array2)
```

Category: Math. Minimum arguments: 1. Maximum arguments: 1.

Available for supported offline calculation.

### Examples

```text
=MUNIT(2)
```

The formula spills the 2 × 2 identity matrix {1, 0; 0, 1}.

Cell and range examples require appropriate input values in the referenced cells. Handle invalid arguments, formula errors and array and spill constraints.

### See Also

- [Formulas](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/formulas/llms-full.txt)
- [Custom Functions and Formula Data](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/custom-functions/llms-full.txt)

---

## Nearby

- **Previous:** [MULTINOMIAL Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/multinomial/llms-full.txt)
- **Next:** [N Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/n/llms-full.txt)
