MDETERM returns the determinant of a square matrix, a single number that summarises key properties of the matrix. It is useful for solving systems of equations, checking invertibility, and analysing linear relationships in data.
=MDETERM(array)What does MDETERM do?
The MDETERM function calculates the determinant of a square matrix. A determinant is a single number that tells you important things about the matrix, such as whether it can be inverted and how it scales areas or volumes. In Excel, you supply a range of cells that form a square matrix (same number of rows and columns), and MDETERM returns the determinant as a number.
Determinants matter in many practical situations. In business, they can help check if a set of linear equations has a unique solution, which is useful for cost allocation, break-even analysis, or solving simultaneous equations. In statistics and data analysis, the determinant of a covariance or correlation matrix indicates multicollinearity. For students, MDETERM is a quick way to verify linear algebra homework without manual calculation.
Imagine you have three equations representing production constraints and you want to know if there is a unique solution. By placing the coefficients in a 3x3 matrix and using MDETERM, you get a non-zero determinant, confirming a unique solution exists. This saves time and reduces errors compared to manual elimination.
When to use MDETERM
- Checking if a system of linear equations has a unique solution
- Testing whether a matrix is invertible (determinant not zero)
- Analysing multicollinearity in regression (determinant of correlation matrix)
- Solving circuit analysis problems in engineering coursework
- Verifying linear algebra homework answers
- Computing area or volume scaling factors in geometry
MDETERM syntax
=MDETERM(array)| Argument | Required? | What to enter |
|---|---|---|
array | Required | A numeric array or range of cells that forms a square matrix (equal number of rows and columns). For example, A1:C3 for a 3x3 matrix. |
What it returns: The determinant of the matrix as a number. If the matrix is singular (determinant zero), it returns 0. If the array is not square or contains non-numeric values, it returns an error.
MDETERM examples
1 Determinant of a 2x2 matrix
This example shows the simplest case: a 2x2 matrix. The goal is to find the determinant of the matrix in cells A1:B2. MDETERM calculates it as (a*d - b*c). For the values 3, 7, 2, 5, the determinant is 3*5 - 7*2 = 15 - 14 = 1. The formula returns 1.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | 3 | 7 | |||
| 2 | 2 | 5 | 1 | ||
| 3 |
2 Checking invertibility of a 2x2 matrix
This matrix has a determinant of zero, meaning it is singular and cannot be inverted. The goal is to demonstrate how MDETERM flags such cases. The formula returns 0, indicating that the rows are linearly dependent (the second row is twice the first).
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | 2 | 4 | |||
| 2 | 1 | 2 | 0 | ||
| 3 |
3 Determinant of a 4x4 matrix
A 4x4 matrix is common in more complex linear systems. The goal is to compute its determinant. MDETERM handles larger matrices efficiently. For this matrix, the determinant is 0, indicating singularity. This could alert you that a system of four equations may not have a unique solution.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | 1 | 2 | 3 | 4 | |||
| 2 | 5 | 6 | 7 | 8 | 6.21228E-30 | ||
| 3 | 9 | 10 | 11 | 12 | |||
| 4 | 13 | 14 | 15 | 16 | |||
| 5 |
4 Business use: cost allocation system
A company allocates costs across three departments based on a system of equations. The coefficient matrix is in A1:C3. The goal is to check if the system has a unique solution. MDETERM returns -1, a non-zero value, confirming that the cost allocation has a unique solution. This helps ensure the allocation model is well-defined.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | 2 | 1 | 1 | |||
| 2 | 1 | 3 | 2 | -1 | ||
| 3 | 1 | 0 | 0 | |||
| 4 |
Common MDETERM errors and how to fix them
| Error | Why it happens | How to fix it |
|---|---|---|
| #VALUE! | The array contains non-numeric values, such as text or empty cells. | Ensure all cells in the matrix contain numbers. Remove any text or blanks, or use IFERROR to handle. |
| #NUM! | The array is not square (rows and columns count differ) or the determinant cannot be computed (e.g., overflow). | Verify the range has the same number of rows and columns. For large matrices, check for numeric stability. |
| #REF! | The range reference is invalid, e.g., deleted cells. | Update the range to a valid square matrix. |
Tips for using MDETERM
- Always ensure your matrix is square; MDETERM requires equal rows and columns.
- Use MDETERM to quickly check if a matrix is invertible: a non-zero determinant means yes.
- For large matrices, be aware of potential floating-point errors; results very close to zero may be effectively zero.
- Combine with MINVERSE to solve linear systems: if MDETERM is non-zero, MINVERSE will work.
- Remember that MDETERM returns a single number, not an array.
Frequently asked questions
What does MDETERM do in Excel?
MDETERM returns the determinant of a square matrix, which is a single number that indicates whether the matrix is invertible and other properties.
Why do I get a #VALUE! error with MDETERM?
The #VALUE! error occurs if the array contains non-numeric values or if the range is not square. Check that all cells contain numbers and the range has equal rows and columns.
Can MDETERM handle a 1x1 matrix?
Yes, MDETERM of a 1x1 matrix returns the single value itself.
What is the maximum size matrix MDETERM can handle?
Excel's MDETERM can handle matrices up to 52x52, but practical limits depend on your version and memory.
Related functions
Every example on this page was recalculated by SheetSkill’s spreadsheet engine. MDETERM reference