+ Reply to Thread
Results 1 to 8 of 8

Adding similar rows for different columns

  1. #1
    Registered User
    Join Date
    08-31-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Adding similar rows for different columns

    Hello,

    I am making a large database one excel and have to make computations in every row. Lets just say for arguments sake I just have to add all the values in column C-F for every row. Is there a command I can input besides "=SUM(C2:F2)" and then copy and paste and then chance the row value for every single row?

    I tried doing "=SUM(C(row()):F(row()))" but it didnt seem to like that at all.

    Any ideas?

    Thanks,

    Riznarf

    EDIT: Furthermore, is there any way to say, "add the 5 cells directly to the left of the active cell"?
    Last edited by riznarf; 08-31-2011 at 05:57 AM.

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Basic Excel Computing Question

    Not sure I really follow. If your reference is relative, which it is in your example, then the formula will adjust as you copy/drag it.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    08-31-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Basic Excel Computing Question

    Quote Originally Posted by Domski View Post
    Not sure I really follow. If your reference is relative, which it is in your example, then the formula will adjust as you copy/drag it.

    Dom
    Thanks for the prompt reply. Heres what I'm getting at:

    A B C D
    1 4 5 6 =SUM(A1:C1)
    2 7 8 9
    3 10 11 12

    the question i have, is that is there any once equation that i can substitute for the equation in D1 that will add the sum of the values in current row for all columns A-C?

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Basic Excel Computing Question

    Nope still don't get it. That's what the Sum formula does. What result are you expecting?

    Dom

  5. #5
    Registered User
    Join Date
    08-31-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Adding similar rows for different columns

    Ok, I'm going to have thousands of rows. Lets say for arguments sake, I have 10,000 rows in this database. Instead of going line by line 10,000 times to drag over the SUM formula so that it will compute the appropriate column/row, is there a SINGLE formula that I can input into all 10,000 fields that will output the sum of just their specific row?

  6. #6
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Adding similar rows for different columns

    Yes, start in row 2 with

    =Sum(A2:F2)

    or whatever columns you want to sum. Then copy the cell down.

    In row 3 the formula will read

    =Sum(A3:F3)

    That's how Excel works. The row numbers will be adjusted automatically.

    You can use the fill handle in the lower right hand corner of the cell and double click it to fill down all rows at once, without having to scroll.

  7. #7
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Adding similar rows for different columns

    If you are totally averse to copying the formula down, try this:

    Select all cells where you want the calculation, for example G2 all the way down to G10000. These cells are now highlighted and G2 appears white. Type the formula

    =Sum(A2:F2)

    and then hold the Ctrl key and hit Enter.

    Bang.

    The formula is automatically filled into each row, with the correct row references in each row.

    (But it's the same formula you get when copying G2 down manually)

    cheers,

  8. #8
    Valued Forum Contributor Miraun's Avatar
    Join Date
    04-03-2009
    Location
    New England
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    554

    Re: Adding similar rows for different columns

    Taking a step back for a minute.

    The concept of "Dragging Down" is to highlight the row with the equation in it.

    In this case, in D1 that contains =Sum(A1:C1).
    Move the cursor over the bottom right portion of the cell, and the icon will change into a + ... not the typical, white interior +, but a compacted, thinner, dark +.
    Left mouse button, and drag down, you'll notice that the original cell that you started at has a heavier shade, and that there's a light outline where you're dragging it to... that will apply that formula to each of those cells...

    Additionally, if there are contents within C all the way down to the end of the list, as soon as you see the alternative + icon, you can double click to have it automatically apply all the way down.
    Going for Guru! Click the Star to the bottom left of this post if I helped!

+ 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