+ Reply to Thread
Results 1 to 17 of 17

multiplying two columns

  1. #1
    Registered User
    Join Date
    03-20-2008
    Posts
    13

    Red face multiplying two columns

    Be nice to me I am an Excel Dummy.
    I would like somebody to advise me on the following.
    Assume column B is 31 cells long with a value in each cell all the way down.
    I wish to progressively add a value to column A (say on a daily basis) which is to be multiplied by the constant value in Column B and showing a total in Column C, at the same time showing a total at the bottom of A and C.
    Any assistance would be appreciated, please forgive my ignorance.

  2. #2
    Registered User
    Join Date
    03-20-2008
    Posts
    2
    Hey COLC, Just in the door myself...

    Presume you'll start at A1, B1 & C1 and are using numbers only.
    Go to C1 and type this: =IF(A1="","",(MMULT(A2,B2)))
    What this means is: IF A1 is Blank then do nothing, otherwise multiply A1 x B1. Next click on C1 and hover over the small black square at the bottom right of the cell (the "Cursor" will change when you are on it), hold the mouse button and drag it all the way down to C31. (This repeats the formula for all the selected cells. (Don't write in these...you'll delete the formulas)

    Now go Col A32 (Where you want to total A) and type: =SUM(
    Select A31, hold the mouse and drag it up to A1 (You'll see a dotted box covering the selected cells that you want.) let go and hit Return/Enter.this adds A1, A2, A3....A31

    Do the same for Col C

    How'd I do?

  3. #3
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191
    The formula in column C could be shortened to =A1*B1. If nothing is in A1, it will just return 0.

  4. #4
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Or even

    =IF(A1="","",A1*B1) if you didn't want to display a zero
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  5. #5
    Registered User
    Join Date
    03-20-2008
    Posts
    13
    A B C
    1 0.5081644 1.0163288
    2 0.5081644 2.540822
    5 0.5081644 2.0326576
    4 0.5081644 3.0489864
    6 0.5081644 2.0326576
    4 0.5081644 #VALUE!
    Thanks Guys,
    I seem to have struck a hurdle at the first!, I have only tried the first part of the formula A X B and as can be seen above the Column C total does not correspond correctly ie A1 X B1 should be 0.5081644 and so on.
    Either I have not explained my problem adequately or made an error somewhere.
    Any clues?

  6. #6
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191
    Just a hunch, but it looks like your formula is =A2*B1. If you have text in A7, this would also explain the error.

  7. #7
    Registered User
    Join Date
    03-20-2008
    Posts
    13
    The formula used is exactly as provided by airman, (cut and pasted).
    No text anywhere at this stage.
    I told you I was a Dummy!

  8. #8
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191
    You should probably try the simpler formulas suggested by oldchippy or myself. MMULT is best used for multiplying one array of cells by another, rather than a single cell by another. If this still doesn't work, please post your workbook.

  9. #9
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi COLC,

    Does this do what you want?
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    03-20-2008
    Posts
    13
    Many thanks guys problem solved, easy isn’t it when willing hands are available?
    My final problem with his project is as per following example.
    Column A is a meter reading which increases daily, column B
    Is the daily total i.e. the difference between A1 and A2 etc.
    Can Excel auto calculate column B from data entered into
    column A

    25.5 1
    27 1.5
    28.5 1.5
    30 1.5
    45 15
    66 21
    75 9
    89 14
    101 12

  11. #11
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191
    In B2, =A2-A1

  12. #12
    Registered User
    Join Date
    03-20-2008
    Posts
    13
    Thanks Darkyam, I tried your suggestion however I could not get it to work, probably because there is a conflict due to column C being multiplied by D which is multiplied by E which is multiplied by F.
    Am I correct in assuming that the correct formula be applied as a whole rather than individually.
    If so further info would be appreciated, as you can see the first row is complete.
    Thanks heaps I assure you I am not normally this thick!!


    A--------B---------C-------D--------E-------F---------G
    DATE READING C MTRS X 38.3= Mjoules TARIFF DAILY $$$
    1 26 4 38.3 153.2 0.508164 2.032656
    2 38.3 0 0.508164 0

  13. #13
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi,

    Can you post an example of your data, it may be easier to understand what you are trying to achieve.

    To post a zipped example, go to “My Documents” or wherever you have your file stored, right-click and “Send to > Compressed file”, then attach this zipped file to your post.

  14. #14
    Registered User
    Join Date
    03-20-2008
    Posts
    13
    Thanks for that OC, I have dudded up a worksheet and attached as suggested.
    This is exactly what I am after with the exception that when I add a value to Col B I require the difference between the new cell and the previous cell entered in Col C, hope that is clear enough.
    Attached Files Attached Files
    Last edited by COLC; 03-23-2008 at 09:22 PM.

  15. #15
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,705
    Perhaps you could try this formula in C4 copied down

    =IF(B4,B4-B3,"")

  16. #16
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Then may be this in E4

    =IF(OR(C4=0,C4=""),"",C4*D4) copied down

  17. #17
    Registered User
    Join Date
    03-20-2008
    Posts
    13
    Thanks to previous advice I have achieved most of what I was after, I have tried all other suggestions regarding auto calculating COL B to COL C as per previous attachment with no luck.
    I shall just have to enter that data manually.
    Won't waste any more of your time thanks for past assistance.
    Last edited by COLC; 03-24-2008 at 08:09 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1