+ Reply to Thread
Results 1 to 21 of 21

How to sum cells that already contain formula

  1. #1
    Registered User
    Join Date
    10-12-2015
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    95

    How to sum cells that already contain formula

    Hi I'm making a ledger, and after every few rows there is a cell that contains the sum of preceding few cells with data. Now I need to arrive at the grand total, but summing all the individual cells take a lot of time. Is there a formula that can do this?

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: How to sum cells that already contain formula

    You get better help on your question if you add a small excel file, without confidential information.

    Please also add manualy the expected result in your file.

    To Attach a File:

    1. Scroll down to the window below your post Additional Options
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    10-12-2015
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    95

    Re: How to sum cells that already contain formula

    Thank you. I have included a sample file. The total of individual accounts are in double bottom and top borders, while I want to total to be displayed in the cells highlighted yellow at the bottom.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,323

    Re: How to sum cells that already contain formula

    Add "Total" in Column D at total calculations rows then


    =SUMIF($D$2:$D$75,"Total",E$2:E$75)

    and

    =SUMIF($D$2:$D$75,"Total",F$2:F$75)



    OR (no changes required)

    =SUMIFS(E2:E73,$C$2:$C$73,">0",$E$2:$E$73,">0")

    and

    =SUMIFS(F2:F73,$C$2:$C$73,">0",$F$2:$F$73,">0")
    Last edited by JohnTopley; 11-14-2015 at 04:17 PM.

  5. #5
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: How to sum cells that already contain formula

    Hi Terry

    if you have a lot of numbers in a column and a sum function every few rows

    Then adding a new sum at the bottom will give you a grand total.

    At least it did for me

    Select the red cell in the attached sample

    And click on auto sum

    Unfortunately empty cells are not allowed in the column.
    Attached Files Attached Files
    Last edited by mehmetcik; 11-14-2015 at 04:14 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  6. #6
    Registered User
    Join Date
    10-12-2015
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    95

    Re: How to sum cells that already contain formula

    Quote Originally Posted by mehmetcik View Post
    Hi Terry

    if you have a lot of numbers in a column and a sum function every few rows

    Then adding a new sum at the bottom will give you a grand total.

    At least it did for me

    Select the red cell in the attached sample

    And click on auto sum

    Unfortunately empty cells are not allowed in the column.
    Thanks. It works in the sheet you uploaded, but in worksheet like mine it is only adding the last cell's total rather than all the totals above.

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,323

    Re: How to sum cells that already contain formula

    Did you try second solution I offered?

    =SUMIFS(E2:E73,$C$2:$C$73,">0",$E$2:$E$73,">0")

    and

    =SUMIFS(F2:F73,$C$2:$C$73,">0",$F$2:$F$73,">0")

  8. #8
    Registered User
    Join Date
    10-12-2015
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    95

    Re: How to sum cells that already contain formula

    Quote Originally Posted by JohnTopley View Post
    Add "Total" in Column D at total calculations rows then


    =SUMIF($D$2:$D$75,"Total",E$2:E$75)

    and

    =SUMIF($D$2:$D$75,"Total",F$2:F$75)



    OR (no changes required)

    =SUMIFS(E2:E73,$C$2:$C$73,">0",$E$2:$E$73,">0")

    and

    =SUMIFS(F2:F73,$C$2:$C$73,">0",$F$2:$F$73,">0")
    Thanks a lot. The one with "no changes required" worked. Can you kindly also briefly explain the logic behind that formula?

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,323

    Re: How to sum cells that already contain formula

    Yes, I simply test the column (C) with the date for being >0 i.e.not blank and the amount column E or F >0 which identifies the Total cells.

    I now realise the last test is redundant so

    =SUMIF($C$2:$C$73,">0",$E$2:$E$73) and =SUMIF($C$2:$C$73,">0",$F$2:$F$73) will work just as well
    Last edited by JohnTopley; 11-14-2015 at 04:39 PM.

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,323

    Re: How to sum cells that already contain formula

    This also will work ...

    =SUMIF($B$2:$B$73,"<>",$E$2:$E$73)

    which effectively finds the total fields by checking column B for a blank entry.

  11. #11
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: How to sum cells that already contain formula

    A simple solution.

    With both yellow cells empty. (It works with your test formula in them, but given that they would normally be empty, I thought it best to clarify that it works both ways).

    Single click E76

    Press Shift & Right Cursor, then hold Shift, Ctrl and Up Cursor together until the selection reaches the top of the sheet. (you will now have E1:F76 selected with E76 as the active cell).*

    Press Alt and = together.

    Check the results.

    edit:-

    * You can use any similar method to achieve the selection, the only requirement for it to work is that the active cell is one of those that the formula should be entered into, I just suggested what I feel is the simplest way.
    For example, Select F76, Shift, Ctrl and Home, Shift Right x 3, Alt =
    Or if you're using a mouse, the traditional method of holding left click and moving up.
    Last edited by jason.b75; 11-14-2015 at 05:26 PM.

  12. #12
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: How to sum cells that already contain formula

    2 other options...

    1. Use SUBTOTAL() instead of any of the SUM functions. You would use ST for the individual sub totals, then 1 again for the crand total, using the whole range - it will ignore all other ST's in teh range

    2. you could just some the entire range above, but divide it by 2
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  13. #13
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: How to sum cells that already contain formula

    As Ford says above, there is a built-in function which does what you want: SUBTOTAL. It can give you sums, averages and lots more, and has the great advantage over the 'normal' Sum/Average/etc that it ignores any other Subtotals in the range you give it. The syntax you want for a sum is =SUBTOTAL(9,range). Assuming you have a lot of data, with a lot of SUMs already there, you could use Find and Replace to replace all the SUMs with SUBTOTALs, like this:
    Find: SUM(
    Replace: SUBTOTAL(9,
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  14. #14
    Registered User
    Join Date
    10-12-2015
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    95

    Re: How to sum cells that already contain formula

    FDibbins and Aardigspook and all others, Thanks a billion. The subtotal function works like a charm, it saved me hundreds of extra key strokes and energy. Wish I knew about this function earlier. Have a nice day!

  15. #15
    Registered User
    Join Date
    10-12-2015
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    95

    Re: How to sum cells that already contain formula

    Quote Originally Posted by jason.b75 View Post
    A simple solution.

    With both yellow cells empty. (It works with your test formula in them, but given that they would normally be empty, I thought it best to clarify that it works both ways).

    Single click E76

    Press Shift & Right Cursor, then hold Shift, Ctrl and Up Cursor together until the selection reaches the top of the sheet. (you will now have E1:F76 selected with E76 as the active cell).*

    Press Alt and = together.

    Check the results.

    edit:-

    * You can use any similar method to achieve the selection, the only requirement for it to work is that the active cell is one of those that the formula should be entered into, I just suggested what I feel is the simplest way.
    For example, Select F76, Shift, Ctrl and Home, Shift Right x 3, Alt =
    Or if you're using a mouse, the traditional method of holding left click and moving up.
    Wow that worked just as well as the subtotal method, but somehow it only works when I have calculated the individual totals with subtotal function rather than simple sum function. Thanks a lot by the way.

  16. #16
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: How to sum cells that already contain formula

    Quote Originally Posted by terry3218 View Post
    Wow that worked just as well as the subtotal method, but somehow it only works when I have calculated the individual totals with subtotal function rather than simple sum function. Thanks a lot by the way.
    Was there anything different about the workbook you tried it with when that happened?

    For me it worked fine with your sample file from post #3 using sum or subtotal.

    Not critical, but I'm curious to find out why it failed for you yet worked for me.

  17. #17
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: How to sum cells that already contain formula

    Quote Originally Posted by terry3218 View Post
    FDibbins and Aardigspook and all others, Thanks a billion. The subtotal function works like a charm, it saved me hundreds of extra key strokes and energy. Wish I knew about this function earlier. Have a nice day!
    As you're using excel 2013, have a look at the AGGREGATE function as well, it's effectively a new version of SUBTOTAL, just far more versatile.

  18. #18
    Registered User
    Join Date
    10-12-2015
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    95

    Re: How to sum cells that already contain formula

    Quote Originally Posted by jason.b75 View Post
    Was there anything different about the workbook you tried it with when that happened?

    For me it worked fine with your sample file from post #3 using sum or subtotal.

    Not critical, but I'm curious to find out why it failed for you yet worked for me.
    I am sorry, I am a noob when it comes to such nuances. But, yes, I tried that on a different file than my sample file.

  19. #19
    Registered User
    Join Date
    10-12-2015
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    95

    Re: How to sum cells that already contain formula

    Quote Originally Posted by jason.b75 View Post
    As you're using excel 2013, have a look at the AGGREGATE function as well, it's effectively a new version of SUBTOTAL, just far more versatile.
    Thank you! I'll definitely look into that function.

  20. #20
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: How to sum cells that already contain formula

    Quote Originally Posted by FDibbins View Post
    2. you could just sum the entire range above, but divide it by 2
    ^ This +1 ^


    =SUM(E5:E74)/2
    Last edited by Jonmo1; 11-16-2015 at 04:10 PM.

  21. #21
    Registered User
    Join Date
    10-12-2015
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    95

    Re: How to sum cells that already contain formula

    Quote Originally Posted by Jonmo1 View Post
    ^ This +1 ^


    =SUM(E5:E74)/2
    Thank you. I'll try that as well

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Formula checks multiple cells for words and outputs answer depending on cells
    By keez1993 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-15-2015, 09:18 AM
  2. Replies: 2
    Last Post: 05-14-2015, 03:19 PM
  3. Replies: 3
    Last Post: 07-26-2014, 06:12 AM
  4. Replies: 1
    Last Post: 03-29-2014, 09:56 AM
  5. Formula needed for dividing 2 sets of cells and excluding adjacent text cells
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-07-2013, 06:45 PM
  6. Replies: 1
    Last Post: 11-20-2012, 10:08 AM
  7. Formula: Drop Down List -> Choose Option Finds Cells & Replace Cells with Cells
    By g00glethis1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-14-2010, 01:10 PM

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