How to Use the MDETERM Function in Google Sheets

To calculate the determinant of a square matrix, you can use the MDETERM function in Google Sheets, which falls under the category of Array functions.

The MDETERM function requires only one argument: square_matrix. As the name suggests, this argument must refer to a matrix with an equal number of rows and columns.

Before diving into the syntax and examples, let’s briefly explore what a matrix determinant is and how to calculate it manually.

Understanding the Matrix Determinant

The determinant is a scalar value that can be computed from the elements of a square matrix. It gives vital information about the matrix, including whether it is invertible; a non-zero determinant indicates that the matrix can be inverted, while a zero determinant means it cannot.

Additionally, the determinant acts as a scaling factor for transformations represented by the matrix. It indicates how much areas or volumes are scaled during a transformation. For example, if the determinant is 2, the transformation doubles the area, whereas a determinant of 0.5 reduces the area by half.

In essence, the determinant is a crucial value that reveals key characteristics of the matrix and its transformations.

Example 1: 2×2 Matrix

Consider the following 2×2 matrix:

12
34

To calculate the determinant of this matrix, use the formula:

Determinant = (1×4)−(2×3)=−2

Example 2: 3×3 Matrix

Now, let’s look at a 3×3 matrix:

123
456
789

You can calculate the determinant of this 3×3 matrix as follows:

Determinant = 1×(5×9−6×8)−2×(4×9−6×7)+3×(4×8−5×7)=0

Calculating the determinant of larger matrices manually can be complex, which is why using the MDETERM function in Google Sheets is a more efficient approach. The usage of this function is the same in both Google Sheets and Excel.

Syntax and Argument of the MDETERM Function in Google Sheets

Syntax:

MDETERM(square_matrix)

Argument:

  • square_matrix: A numeric range (array) with an equal number of rows and columns.

Example of the MDETERM Function

To use the MDETERM function, you can specify a range of cells that represents the square matrix. For example:

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

In this example, the square matrix is defined by the cell range B2:D4. Alternatively, you can specify the matrix as an array constant, like this:

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

Common Formula Errors in Determinant Calculation

When using the MDETERM function, you may encounter two common types of errors: #VALUE! and #N/A errors.

  • #VALUE! Error: This error appears when one or more cells in the square matrix are blank or contain non-numeric text. To resolve this error, wrap the array or range with the N function, which converts blank cells or strings to zero:
=ArrayFormula(MDETERM(N(B2:D4)))
Error in Determinant Calculation in Google Sheets

The ARRAYFORMULA function is necessary here because N is a non-array function in Google Sheets.

Another cause of the #VALUE! error is using a non-square matrix as the argument.

  • #N/A Error: This error indicates that the MDETERM function has received multiple arguments. Remember, the function only accepts a single argument representing one square matrix.

Conclusion

That’s all about calculating the determinant using the MDETERM function in Google Sheets. This powerful function can simplify complex calculations and provide quick insights into your data. Enjoy using MDETERM to enhance your spreadsheet analyses!

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.

Filter Top N per Category in Excel (Using FILTER & COUNTIFS)

You can use a combination of FILTER and COUNTIFS to filter the top N...

Rank per Group in Excel

You have two groups of 20 students each. How do you determine the rank...

Real-Time Excel Filtering Using Combo Box & FILTER Function

In this tutorial, you’ll learn how to set up real-time Excel filtering using a...

Google Sheets: Extract Top N per Group from Query Aggregation

When working with grouped and aggregated data in Google Sheets, you might need to...

More like this

Google Sheets: Extract Top N per Group from Query Aggregation

When working with grouped and aggregated data in Google Sheets, you might need to...

How to Extract Top N from Aggregated Query Results in Google Sheets

To summarize data in Google Sheets, you can use the QUERY function. However, if...

How to Use RANK IF in Google Sheets (Conditional Ranking)

You can use the RANK function to rank values in an entire dataset. But...

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.