Simultaneous Equations Solver in Excel
For a small square linear system, arrange the coefficients as matrix A and the constants as vector b, then calculate x = A⁻¹b with Excel's MINVERSE and MMULT functions. Verify the result before using it.
Written and checked by TheToolNet Editorial Team · Last reviewed: August 21, 2026 · Editorial policy
This example expects a 2×2 coefficient matrix in A2:B3 and right-side constants in D2:D3.
1. Put the system into matrix form
Consider 2x + 3y = 13 and x − y = −1. Write the system as A𝐱 = b. Enter only coefficients and constants, not variable letters or equal signs.
| Cell | A | B | C | D |
|---|---|---|---|---|
| 1 | x coefficient | y coefficient | constant | |
| 2 | 2 | 3 | 13 | |
| 3 | 1 | −1 | −1 |
The coefficient matrix is A2:B3 and the constants vector is D2:D3. Keep the equation order consistent across both ranges.
2. Calculate x and y
Select an empty cell such as F2 and enter:
=MMULT(MINVERSE(A2:B3),D2:D3)
In current dynamic-array versions of Excel, the two answers spill into F2:F3. The first value corresponds to x and the second to y. This example returns 2 and 3.
For a 3×3 system, the pattern is the same: place the nine coefficients in a 3×3 range, the constants in a three-cell column, and use those ranges in MINVERSE and MMULT.
3. Verify the Excel result
Do not stop at the inverse formula. Multiply A by the returned solution and compare it with b. If the answers occupy F2:F3, enter this in H2:
=MMULT(A2:B3,F2:F3)
The output should reproduce 13 and −1. You can also calculate =MDETERM(A2:B3). A zero determinant means the inverse formula cannot provide a unique solution; use elimination or a rank-aware tool to distinguish no solution from infinitely many solutions.
When should you use the Excel Solver add-in?
MINVERSE and MMULT fit a square linear system with a nonsingular coefficient matrix. Excel's Solver add-in is more appropriate when the equations are nonlinear, variables have upper or lower bounds, additional constraints apply, or the task is really optimization.
- Place trial values for the unknowns in cells.
- Build formulas that calculate each equation's left side and a residual against its required right side.
- Combine residuals into an objective, commonly the sum of squared residuals.
- Open Data › Solver, minimize that objective to 0, choose the changing variable cells, and add any genuine constraints.
Solver is iterative, so a small residual is an approximation rather than a symbolic proof. Different starting values can matter for nonlinear systems.
Common Excel problems
| Problem | Likely cause | Fix |
|---|---|---|
| #VALUE! | Matrix dimensions are incompatible or cells contain text. | Use a square numeric coefficient range and a constants column with the same number of rows. |
| #NUM! | The coefficient matrix is singular and has no inverse. | Check for dependent or inconsistent equations with elimination. |
| Wrong variable values | Coefficient or constant rows are out of order. | Keep every row aligned with the same original equation. |
| Solver is missing | The add-in is not enabled. | Follow Microsoft's instructions to load the Solver add-in. |
Frequently asked questions
What Excel formula solves simultaneous equations?
For a small nonsingular square linear system, use MMULT(MINVERSE(coefficient_range), constant_range).
Can Excel solve three simultaneous equations?
Yes. Use a 3×3 coefficient range and a three-row constants range. The output contains one value for each variable in the same column order as the coefficients.
Does Excel Solver replace MINVERSE and MMULT?
No. Matrix functions directly calculate a small square linear system. Solver is useful for nonlinear relationships, constraints and optimization.
Official Excel references
- Microsoft Support: MINVERSE function
- Microsoft Support: define and solve a problem using Solver
- Microsoft Support: load the Solver add-in
For a browser-based answer with rank classification and row steps, return to the simultaneous equations solver. For code, see the MATLAB guide.