MINVERSE: Compute Inverse Matrix for Solving Equations

MINVERSE function in Excel tutorial showing inverse matrix calculation syntax examples matrix operations and linear algebra
Understand how to calculate inverse matrices in Excel using the MINVERSE function. This tutorial explains the MINVERSE syntax, matrix requirements, dynamic array behaviour, common errors, and practical applications in solving linear equations and mathematical models. You’ll also learn how to combine MINVERSE with MMULT and other matrix functions to perform advanced calculations directly in Excel. Ideal for students, engineers, analysts, researchers, and Excel users working with matrix operations, data modelling, and quantitative analysis.

Solving a system of equations by hand gets painful fast. Three unknowns already mean a page of substitution. Five unknowns feel impossible. Linear algebra offers a cleaner path: the inverse matrix. If you can invert the coefficient matrix, you can solve the whole system in one move. The MINVERSE function computes that inverse for you. It takes a square matrix and returns its inverse, ready to plug into a solution formula.

This guide explains what an inverse matrix is and when one exists. Then it shows how MINVERSE works with the dynamic array and legacy methods. Six examples cover the classic use of solving equations, plus a full troubleshooting section.

What an Inverse Matrix Is

The inverse of a matrix works like the reciprocal of a number. For a number, 4 times one-quarter equals 1. For a matrix, A times its inverse equals the identity matrix. The identity matrix is the matrix version of the number 1. It has ones down the diagonal and zeros elsewhere. Multiplying by it changes nothing. The infographic below shows this relationship.

A matrix times its inverse gives the identity matrix MATRIX A 4 7 2 6 x A-INVERSE 0.6 -0.7 -0.2 0.4 = IDENTITY (I) 1 0 0 1 The identity matrix has 1s on the diagonal and 0s everywhere else. =MINVERSE(A1:B2) returns the inverse matrix Only square matrices with a non-zero determinant have an inverse. Solve equations with: x = MINVERSE(A) . b

This property is what makes inverses useful. Because A times its inverse gives the identity, the inverse can undo what A does. Consequently, it lets you isolate the unknowns in a system of equations.

When an Inverse Exists

Not every matrix has an inverse. Two conditions must hold. First, the matrix must be square, with equal rows and columns. Second, its determinant must not be zero. A matrix with a zero determinant is called singular, and it has no inverse. This mirrors division by zero for plain numbers. You cannot divide by zero, and you cannot invert a singular matrix. Therefore, a quick determinant check is wise before you invert.

Check first, invert second. Use =MDETERM(range) before MINVERSE. If the determinant is not zero, an inverse exists. If it is zero, stop, because the matrix is singular and MINVERSE will fail.

The Syntax

MINVERSE needs only one argument. It returns an array of the same size as the input. In Excel 365, that array spills automatically.

Syntax: =MINVERSE(array) array -> a SQUARE range with a non-zero determinant. Examples: A1:B2 (2x2), A1:C3 (3x3). Returns: the inverse matrix, same size as the input. In Excel 365 it spills. In older Excel, select the same-size block and press Ctrl+Shift+Enter.

Example 1: Invert a 2x2 Matrix

Begin with the simplest case. A 2x2 inverse is easy to verify by eye. Once you trust it here, larger matrices follow the same idea. The steps never change with size. Only the amount of arithmetic grows. That is exactly why MINVERSE is so useful.

Invert a small matrix: Matrix A in A1:B2 : [ 4 7 ] [ 2 6 ] First check: =MDETERM(A1:B2) = (4*6)-(7*2) = 10 (not zero) Then invert: =MINVERSE(A1:B2) Result: [ 0.6 -0.7 ] [ -0.2 0.4 ] Multiply A by this inverse and you get the identity matrix.

Example 2: The Dynamic Array Method

In Excel 365 and 2021, MINVERSE is easy to enter. You type it once and press Enter. The inverse then spills to fill its space. As a result, no pre-selection is needed.

1.
Confirm the matrix is square and its determinant is not zero.
2.
Click an empty cell with room to spill right and down.
3.
Type =MINVERSE(A1:C3) and press Enter.
4.
The inverse appears, outlined as a spill range.

Example 3: The Legacy Ctrl+Shift+Enter Method

Older Excel needs array entry. The inverse is the same size as the input. So you select a block of that size first. Then you confirm with three keys.

Legacy steps (Excel 2019 and earlier): For a 3x3 matrix, the inverse is also 3x3. 1. Select an EMPTY block exactly 3 rows x 3 cols. 2. Type: =MINVERSE(A1:C3) 3. Press: Ctrl + Shift + Enter Excel shows it as an array formula: {=MINVERSE(A1:C3)}. The inverse fills your selected block.
Match the size exactly. The inverse has the same dimensions as the original. Select a same-size square block before entering. A wrong size cuts the result off or shows #N/A.

Example 4: Solve a System of Equations

This is the headline use of MINVERSE. A system of equations can be written as A times x equals b. Here A holds the coefficients, and b holds the answers. The solution is the inverse of A times b. This one formula replaces pages of manual algebra. In Excel, MINVERSE and MMULT do this together. The pair solves the whole system at once.

Solve three equations at once: The system: 2x + 1y + 1z = 8 1x + 3y + 2z = 13 1x + 0y + 0z = 2 Coefficients A in A1:C3 : [ 2 1 1 ] [ 1 3 2 ] [ 1 0 0 ] Answers b in E1:E3 : 8 / 13 / 2 Solution: =MMULT(MINVERSE(A1:C3), E1:E3) This spills x, y, z as a 3x1 column.

Example 5: Verify the Inverse Is Correct

It is good practice to check an inverse. The test is simple. Multiply the original matrix by its inverse. The result should be the identity matrix. If it is, your inverse is correct. This quick check catches range or data mistakes early.

Confirm with the identity test: Original A in A1:C3. Inverse placed in E1:G3. Test: =MMULT(A1:C3, E1:G3) Expected result (the identity): [ 1 0 0 ] [ 0 1 0 ] [ 0 0 1 ] You may see tiny values like 1E-16 instead of clean zeros. That is floating-point rounding, and it is normal.

Example 6: Guard Against a Singular Matrix

A robust model checks before it inverts. If the determinant is zero, MINVERSE returns an error. You can prevent that with a simple guard. Wrap the logic in an IF that tests the determinant first. This gives a clear message instead of a cryptic error.

A safe inverse pattern: =IF(MDETERM(A1:C3)=0, "Cannot invert - matrix is singular", MINVERSE(A1:C3)) How it behaves: Determinant = 0 -> shows a friendly warning. Determinant <> 0 -> returns the inverse as normal. This keeps your workbook readable when inputs change. Anyone using it sees a plain message, not #NUM!.

Example 7: Solve a Blending Problem

Here is a real business use. Suppose you mix two products to hit a target. Each product contributes a known amount of two ingredients. You want the exact quantities to reach a goal. This is a small system, and MINVERSE solves it cleanly.

Find the right mix of two products: Product X gives 2 units protein, 1 unit fibre per kg. Product Y gives 1 unit protein, 3 units fibre per kg. Target: 10 units protein, 15 units fibre. Coefficients A in A1:B2 : [ 2 1 ] [ 1 3 ] Targets b in D1:D2 : 10 / 15 Solution: =MMULT(MINVERSE(A1:B2), D1:D2) Result: 3 kg of X and 4 kg of Y. Check: (2x3)+(1x4)=10 protein, (1x3)+(3x4)=15 fibre.
Why this helps: The same method scales to more products and ingredients. Add rows and columns, and MINVERSE still finds the mix.

Troubleshooting MINVERSE

All three problems below are the most common. Each has a clear cause and a quick fix.

You get a #NUM! error

A #NUM! error means the matrix cannot be inverted. Almost always, its determinant is zero, so the matrix is singular. Check with =MDETERM(range) first. If the result is zero, no inverse exists, and no formula change will fix that. The issue is the data itself. Look for rows or columns that are duplicates or simple multiples of each other, because these force a zero determinant. Adjust the underlying values so the matrix is no longer singular. Then MINVERSE will work.

You get a #VALUE! error

This error points to the shape or the data, not the maths. First, confirm the range is square, because MINVERSE needs equal rows and columns. A non-square block triggers the error at once. Second, check that every cell holds a number. Text, labels, or blank cells inside the range cause a #VALUE! result. Scan the block for stray entries and gaps. Replace blanks with numbers and remove any text. Once the range is square and fully numeric, the inverse calculates correctly.

The inverse shows tiny numbers instead of clean values

Sometimes an inverse contains values like 5E-17 where you expected zero. This is floating-point rounding, and it is completely normal. The calculation carries tiny errors that appear in the output. In most cases these values are harmless. If they bother you or affect a later step, wrap the result with ROUND to a sensible number of decimals. For example, round to ten places to clean up the display. The underlying answer stays correct while the tiny artefacts disappear.

Frequently Asked Questions

  • What does the MINVERSE function do in Excel?+
    MINVERSE calculates the inverse of a square matrix and returns it as an array. The inverse is like a reciprocal for matrices: when you multiply the original matrix by its inverse, you get the identity matrix. This property lets the inverse undo the original transformation, which is what makes it useful for solving equations. You write it as =MINVERSE(range), where the range is a square block of numbers. In Excel 365 the result spills automatically; in older versions you select a same-size block and press Ctrl+Shift+Enter. The matrix must be square with a non-zero determinant.
  • Why does MINVERSE return a #NUM! error?+
    A #NUM! error means the matrix has no inverse because it is singular, which happens when its determinant is zero. Check the determinant first with =MDETERM(range). If it returns zero, the matrix cannot be inverted, and this is a property of the data rather than a formula mistake. Singular matrices often contain a row or column that duplicates another or is a simple multiple of it. To fix the problem, adjust the underlying values so the matrix is no longer singular. Running the determinant check before inverting prevents this error entirely.
  • How do I solve equations using MINVERSE?+
    Write your system in the form A times x equals b, where A holds the coefficients and b holds the answers. The solution is the inverse of A multiplied by b. In Excel, combine the two matrix functions: =MMULT(MINVERSE(A1:C3), E1:E3). MINVERSE inverts the coefficient matrix, and MMULT multiplies that inverse by the answers column. The result spills as a column containing the values of your unknowns. Before solving, confirm that =MDETERM(A1:C3) is not zero, because a singular coefficient matrix has no inverse and the system would have no unique solution.
  • Why does my inverse contain tiny numbers like 1E-16?+
    Those tiny values come from floating-point rounding inside the calculation, and they are normal. Where you expect a clean zero, you may see something like 5E-17 instead. The true value is zero, but small numerical errors accumulate during the matrix operations. In most cases these artefacts are harmless and can be ignored. If they clutter your display or interfere with a later comparison, wrap the result with ROUND to a sensible number of decimal places. This cleans up the appearance while keeping the underlying answer accurate for any further calculations.