HomeGoogle DocsSpreadsheetHow to Use the MDETERM Array Function in Google Sheets

How to Use the MDETERM Array Function in Google Sheets

Published on

To calculate the matrix determinant of a square matrix we can use the MDETERM function in Google Sheets. It’s categorized under the Array functions.

The MDETERM function takes only one argument and that’s the ‘square_matrix’.

From the argument itself, we can understand that the matrix must have the same number of rows as columns (square matrix).

Before going to the syntax as well as formula, let’s understand the basics (calculation explanation) of the matrix determinant of a matrix.

Here are two examples in that the first one is using a 2×2 matrix that is easy to understand.

12
34

The calculation of the matrix determinant of this 2×2 matrix is as below.

=(1*4)-(2*3)=-2

What about a 3×3 matrix (3-row and 3-column array)?

123
456
789

In such case the matrix determinant would be calculated as below.

=1*(5*9-8*6)-4*(2*9-8*3)+7*(2*6-5*3)=0

Manually calculating the determinant of a matrix may be tough. So better we can use the MDETERM function in Google Sheets or Excel for this. The usage is the same in these applications.

Syntax and Argument of the MDETERM Function in Google Sheets

Syntax:

MDETERM(square_matrix)

Argument:

square_matrix – A numeric range (array) with equal number of rows and columns.

Example (MDETERM Formula)

=MDETERM(B2:D4)
Example to MDETERM Function in Google Sheets

In the above example, the ‘square_matrix’ has been specified as a cell range. You can specify it as an array constant too. Here is that example.

=MDETERM({1,2,3;4,5,6;7,8,9})

Common Formula Errors in Determinant Calculation

You may happen to see two types of errors in the use of the MDETERM array function in Google Sheets. They are VALUE! error and N/A! error. The latter is not common though.

VALUE! – appears when a cell(s) is blank or text/string in the square matrix.

If this is the case you can solve the error by wrapping the array/range with the N function that would covert the blank cell or string to 0.

=ArrayFormula(MDETERM(n(B2:D4)))

The ArrayFormula function is a must (with the formula) in this type of usage as N is a non-array Google Sheets function.

Error in Determinant Calculation in Google Sheets

Another reason for the VALUE! error is the use of a non-square matrix as the argument.

N/A! – If you see this error in the MDETERM function in Google Sheets, it may be because of the use of matrices (multiple arguments). You are only permitted to use one argument in this function.

That’s all about the determinant calculation using MDETERM formula in Google Sheets. Enjoy!

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Get the First or Last Row/Column in a New Google Sheets Table

If you've recently started using the new Google Sheets TABLE functionality, you may find...

UNIQUE Function in Visible Rows in Google Sheets

The UNIQUE function doesn't inherently include only visible rows when it returns values, discarding...

Customizing Alternating Colors of a Table in Google Sheets

Google Sheets' new table feature offers limited options for customizing colors. While you can...

Structured Table References in Formulas in Google Sheets

When you create a Google Sheets table by inserting custom tables or converting a...

More like this

Get the First or Last Row/Column in a New Google Sheets Table

If you've recently started using the new Google Sheets TABLE functionality, you may find...

UNIQUE Function in Visible Rows in Google Sheets

The UNIQUE function doesn't inherently include only visible rows when it returns values, discarding...

Customizing Alternating Colors of a Table in Google Sheets

Google Sheets' new table feature offers limited options for customizing colors. While you can...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.