Matrix Multiplication and Inversion in LibreOffice Calc

LibreOffice Calc includes powerful built-in functions designed for linear algebra operations, specifically MMULT for multiplying matrices and MINVERSE for inverting square matrices. Because matrix operations produce results spanning multiple cells, both functions operate as array formulas, requiring specific input dimensions and execution methods to return accurate mathematical outputs.

Matrix Multiplication: MMULT

The MMULT function calculates the matrix product of two arrays. For multiplication to be valid, the number of columns in the first matrix must equal the number of rows in the second matrix.

How to Use MMULT:

  1. Identify the dimensions of the result. If Matrix A is \(m \times k\) and Matrix B is \(k \times n\), the resulting matrix will be \(m \times n\).
  2. Select an empty range of cells matching the \(m \times n\) output dimensions.
  3. Type the formula referencing your two ranges, for example: =MMULT(A1:B3; D1:E2).
  4. Press Ctrl + Shift + Enter to apply the formula as an array function. LibreOffice Calc will enclose the formula in curly braces {} and populate the selected range.

Matrix Inversion: MINVERSE

The MINVERSE function computes the inverse of a given matrix. The target matrix must be a square matrix (equal number of rows and columns) and must have a non-zero determinant (non-singular).

How to Use MINVERSE:

  1. Determine the size of the square matrix (e.g., \(n \times n\)).
  2. Select an empty destination range of the exact same size (\(n \times n\)).
  3. Enter the formula referencing the source matrix, for example: =MINVERSE(A1:C3).
  4. Press Ctrl + Shift + Enter to evaluate the array formula.

Essential Rules and Error Handling