1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

MS Excel matrix multiply?

Discussion in 'Other PC Software' started by Roger at CCCC, 2007/07/24.

  1. 2007/07/24
    Roger at CCCC

    Roger at CCCC Inactive Thread Starter

    Joined:
    2003/05/22
    Messages:
    234
    Likes Received:
    0
    I have a matrix in Excel where the vertical axis consists of about 25 cells each of which contains a number. The horizontal axis consists of about 20 cells, each of which also contains a number. I would like each cell within the matrix to contain the product (simple multiplication) of the corresponding cells on the vertical and horizontal axes. This is around 250 different formulas to do all the multiplications. Is there a way to make Excel create these formulas (or the resulting product) without me having to type them all in?

    Thanks for any suggestions !!!
     
  2. 2007/07/28
    Bilb0

    Bilb0 Inactive

    Joined:
    2007/07/23
    Messages:
    203
    Likes Received:
    6
    Step 1:
    The multiplier values of the vertical axis are already populated in A2, A3, A4, ..., A26
    The multiplier values of the horizontal axis are already populated in B1,C1,D1,...,U1

    Step 2:
    Click in cell B2
    type this formula; =A2*B$1
    Press (enter)

    Step 3 (method 1):
    Now select cells B2:B26
    Click EDIT>FILL>DOWN

    Step 3 (method 2):
    Select cell B2
    Move your mouse over the LOWER RIGHT corner of the cell until you see the cursor change to a thin "+" symbol.
    When you see it change to the "+" symbol, click, hold, and drag down all the way to cell B26.

    Step 3 completion should have the results for the value in cell B1 multiplied each cell A2 through A26

    Step 4:
    Click and highlight cells B2:B26
    Click EDIT>FIND
    In the FIND AND REPLACE DIALOG BOX, in the "Find what:" field type $
    Click the REPLACE tab
    LEAVE THE "Replace with:" field totally blank
    Click the "Replace All" button.
    You should get a Microsoft Excel pop up indicating 25 replacements were made.
    Click OK

    Step 5:
    STILL IN THE FIND AND REPLACE DIALOG BOX
    In the "Replace what:" field type A
    In the "Replace with:" field type $A
    click the "Replace All" button
    You should get a Microsoft Excel pop up indicating 25 replacements were made.
    Click OK
    Click close

    Step 6 (method 1)
    Now select cells B2:U26
    Click EDIT>FILL>RIGHT

    Step 6 (method 2)
    Select cells B2:B26
    Move your mouse over the LOWER RIGHT corner of the selected cells until you see the cursor change to a thin "+" symbol.
    When you see it change to the "+" symbol, click, hold, and drag right all the way to cell U26.

    You're done
    By the way 20 column by 25 rows is 500 calculations, not 250.

    The two observation lessons here are:

    Firstly. that the $ symbol fixes that column and/or row reference when either copy/paste, or array fill formulas.

    In this case the reference B$1 fixes the row multiplier at row 1
    Then, the reference $A2 fixes the column multiplier on column A

    Another example would be the reference $A$2 would fix both the row and column.

    Secondly: you can use the Find/Replace with much utility, even as in this case, to find a string, and replace it with nothing, which has the net effect of removing the string entirely.

    enjoy!
     
    Last edited: 2007/07/28

  3. to hide this advert.

  4. 2007/07/29
    Roger at CCCC

    Roger at CCCC Inactive Thread Starter

    Joined:
    2003/05/22
    Messages:
    234
    Likes Received:
    0
    Thanks, Bill, I did in fact finally do something similar to what you outlined. The only thing I didn't realize was that Find/Replace could be used to modify formulas. Thanks again !!
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.