Excel MUNIT Function
The MUNIT function creates a unit matrix for a given specified dimension.
The MUNIT function returns a unit matrix.
- If you are using the Excel versions that are prior to Microsoft 365, you should select the output range first, then enter the MINVERSE formula in the top-left-cell of the output range, and then press Ctrl + Shift + Enter to apply the function. For the users of Microsoft 365 and newer versions of Excel, you can just enter the formula in a cell, and then press Enter.
- If you set dimension as 3, then the size of the output range you selected should be 3 x 3.
- MINVERSE will return the #N/A error if the cells you selected that are outside the range of the resulting matrix.
- MDETERM will return the #VALUE! error if dimension ≤ 0.
- MINVERSE will return the #NAME? error if dimension is not a numeric value.
Supposing you are using one of the Excel versions that are prior to Microsoft 365, to create a unit matrix with the dimension of 4, please select an output range with the size of 4 x 4, then copy or enter the formula below in the top-left-cell of the output range, and press Ctrl + Shift + Enter to get the result: