# Simple Excel 97 Question

**URL:** <https://boards.straightdope.com/t/simple-excel-97-question/151005>\
**Category:** Factual Questions\
**Created:** [January 26, 2003, 7:10am UTC](https://boards.straightdope.com/t/simple-excel-97-question/151005 "2003-01-26T07:10:52Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![Urban\_Ranger](https://avatars.discourse-cdn.com/v4/letter/u/e9c0ed/32.png) [@Urban\_Ranger](https://boards.straightdope.com/u/Urban_Ranger)\
**Post date:** [January 28, 2003, 9:05am UTC](https://boards.straightdope.com/t/simple-excel-97-question/151005/21 "2003-01-28T09:05:51Z")

</div>

Thanks much for the help. I’ll try it out.

---

<div class="post-metadata">

**Author:** ![Urban\_Ranger](https://avatars.discourse-cdn.com/v4/letter/u/e9c0ed/32.png) [@Urban\_Ranger](https://boards.straightdope.com/u/Urban_Ranger)\
**Post date:** [January 28, 2003, 2:46pm UTC](https://boards.straightdope.com/t/simple-excel-97-question/151005/22 "2003-01-28T14:46:00Z")

</div>

> [@](#):
>
> \*Originally posted by cmosdes \*  
> I played more with the ctrl-shift-enter function, and I don’t think it will do what you want. It does Matrix Multiplication great, though.

Sorry, how does that work again?

---

<div class="post-metadata">

**Author:** ![cmosdes](https://avatars.discourse-cdn.com/v4/letter/c/a587f6/32.png) [@cmosdes](https://boards.straightdope.com/u/cmosdes)\
**Post date:** [January 30, 2003, 2:03am UTC](https://boards.straightdope.com/t/simple-excel-97-question/151005/23 "2003-01-30T02:03:39Z")

</div>

Matrix multiplication:

[A]\*\* = [C]

A is an mxn matrix (m rows, n columns)  
B is an nxp matrix (n rows, p columns)  
C will be mxp

Note how the columns of A match the rows of B. This must be true for matrix multiplication.

C(i,j) = Sum(A(i,x)\*B(x,j)) for x = 1 to n

This equation is confusing, but what it boils down to is this:

To calculate an element in C, you move along the rows of A and down the columns of B, adding up the results of the multiplication. A good text can explain this better than I can right now. I need paper to draw with.

Example:

A = 1 2 3  
4 5 6

B = 2 3  
8 9  
1 1

A is 2x3  
B is 3x2

C will be 2x2

C(1,1) = A(1,1)_B(1,1) + A(1,2)B(2,1) + A(1,3)B(3,1)  
= 12 + 28 + 3_1  
= 2 + 16 + 4  
= 21

Note how we go across the first row of A, and down the first column of B.  
C(1,2) = 1_3 + 2_9 + 3\*1 = 24

C(2,1) = 4_2 + 5_8 + 6\*1 = 54

C(2,2) = 4_3 + 5_9 + 6\*1 = 63

C = 21 24  
54 63

To do this in excel:

Enter the A matrix anywhere.  
Enter the B matrix anywhere.

Move the cursor to some area with 2x2 cells open. Highlight them. Enter:  
=MMULT((HIGHLIGHT A MATRIX, HIGHLIGHT B MATRIX))  
then hold down the shift,ctrl and enter keys.

I can email an example if you wish, but I doubt it will make much sense without seeing the the keystrokes.

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [January 30, 2003, 2:42am UTC](https://boards.straightdope.com/t/simple-excel-97-question/151005/24 "2003-01-30T02:42:47Z")

</div>

If C = AB, c[sub]ij[/sub] is the dot product of a[sub]i[/sub] and b[sub]j[/sub].

If you’re comfortable with VBA, you could write a macro to do this. It’d take me a while, but it’s worth looking into.

---

<div class="post-metadata">

**Author:** ![Urban\_Ranger](https://avatars.discourse-cdn.com/v4/letter/u/e9c0ed/32.png) [@Urban\_Ranger](https://boards.straightdope.com/u/Urban_Ranger)\
**Post date:** [January 30, 2003, 9:16am UTC](https://boards.straightdope.com/t/simple-excel-97-question/151005/25 "2003-01-30T09:16:30Z")

</div>

Maybe if the itch gets big enoug 🙂

---

<div class="post-metadata">

**Author:** ![Docklands](https://avatars.discourse-cdn.com/v4/letter/d/47e85d/32.png) [@Docklands](https://boards.straightdope.com/u/Docklands)\
**Post date:** [January 30, 2003, 1:19pm UTC](https://boards.straightdope.com/t/simple-excel-97-question/151005/26 "2003-01-30T13:19:59Z")

</div>

I use excel all day every day so I’ll see if I can help.

Firstly, excel has a limited number of columns, so your matrix number of colums will be limited by this. Assuming that you have less rows than this then this is what I would do.

Start your two columns in cells A2 and B2 going downwards. Select and highlight column 1 (Put your cursor in cell A2 and hold Ctrl+Shift and hit down) Hit Ctrl C to copy, then move to cell C1 and hit Alt then e then s then e then enter. (Paste special transpose, you should see your column stretching as a row to the right) Now in cell C2 type

=$B3+C$1

If you now highlight your whole matrix, from C2 right and down and hit Ctrl R and then Ctrl D to fill the formulas out.

You can easily do this with offset functions as well, but why bother as it is so much harder to check the formulas

[Previous page](https://boards.straightdope.com/t/simple-excel-97-question/151005.md?page=1)
