How do I do matrix subtraction in Excel?

1 Answer
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:

#((5,9,2),(4,1,3),(7,9,3)) # and #((7,3,1),(2,6,4),(2,8,5)) #

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

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:
enter image source here

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.

enter image source here