# How do I do matrix subtraction in Excel?

Jun 5, 2015

As I use Linux as my operating system, I don't have Excel, so I'll use LibreOffice Calc to illustrate the matrix substraction procedure. This shouldn't be a problem, because the syntax is exactly the same as in Excel.

Consider the following two matrices:

$\left(\begin{matrix}5 & 9 & 2 \\ 4 & 1 & 3 \\ 7 & 9 & 3\end{matrix}\right)$ and $\left(\begin{matrix}7 & 3 & 1 \\ 2 & 6 & 4 \\ 2 & 8 & 5\end{matrix}\right)$

Enter the matrices in your spreadsheet program as arrays of number cells separated by an empty column:

Next, select an array of empty cells of the same size as the given matrices (3 x 3) -- notice the orange selected area in the image below:

In the formula bar, write =(a1:c3)-(e1:g3) and press Ctrl-Shift-Enter (don't just press Enter, because it will not work). The result of the substraction will appear in the selected area I1:K3.