+ Reply to Thread
Results 1 to 8 of 8

Multiple Sums/Subtotal with changing number of cells between

  1. #1
    Registered User
    Join Date
    03-26-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    9

    Multiple Sums/Subtotal with changing number of cells between

    Joe 2
    John 1
    Sara 2.5
    Fred 1
    Sam 8
    SUM1
    George 1
    John 1
    Joe 1
    Lisa 8
    SUM2

    I can't find this answer anywhere. I want to be able to sum everything above SUM1 line, and everything above SUM2 line until it reaches SUM1. I have several hundred rows where I need to add a sum, but the number of cells between each one varies. How could I do this? The names start in A1, and the numbers start in B1.

    Thanks for any and all help!

  2. #2
    Forum Contributor
    Join Date
    06-28-2016
    Location
    Pennsylvania, USA
    MS-Off Ver
    2013
    Posts
    308

    Re: Multiple Sums/Subtotal with changing number of cells between

    type =sum(

    then select the range you wish to sum, while holding down the shift key, then end you parenthesis.

    So, in your example, if that is starting in A1, in cell B6, you would end up with:

    =sum(B1:B5)

    and in cell B11

    =sum(B6:B10)

    Alternatively, you can manually type it in.

    Hope this helps.

  3. #3
    Registered User
    Join Date
    03-26-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Multiple Sums/Subtotal with changing number of cells between

    I want to be able to do that without manually entering a sum function into several hundred cells. Is there a way to highlight all of my "SUM rows", filter by that color, paste formula and remove filters? Is there a way to sum until adjacent cell hits a blank?

  4. #4
    Forum Contributor
    Join Date
    06-28-2016
    Location
    Pennsylvania, USA
    MS-Off Ver
    2013
    Posts
    308

    Re: Multiple Sums/Subtotal with changing number of cells between

    The closest thing I can think of to what you are describing is fairly resource heavy, but yes, it can be done.

    Depending on how often you need to insert the values, this may or may not be a better solution:

    in cell C1 in your given sample data:

    Please Login or Register  to view this content.
    It will not put it directly into the column, but it will show up only where your values should be. However, since it is dragged down as far as the data is, it will make your file size unnecessarily larger, and depending upon how much data you have, that might be a concern.

  5. #5
    Registered User
    Join Date
    03-26-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Multiple Sums/Subtotal with changing number of cells between

    Finally found the answer here https://www.extendoffice.com/documen...til-blank.html

    Thanks for your input though.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Multiple Sums/Subtotal with changing number of cells between

    Here's one way...

    Data Range
    A
    B
    C
    1
    Name
    Value
    Total
    2
    John
    1
    3
    Sara
    2.5
    4
    Fred
    1
    5
    Sam
    8
    6
    SUM1
    12.5
    7
    George
    1
    8
    John
    1
    9
    Joe
    1
    10
    Lisa
    8
    11
    SUM2
    11


    This formula entered in C2 and copied down:

    =IF(COUNT(B2),"",SUM(B$2:B2)-SUM(C$1:C1))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    Registered User
    Join Date
    03-26-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Multiple Sums/Subtotal with changing number of cells between

    Thanks Tony!

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Multiple Sums/Subtotal with changing number of cells between

    You're welcome!

+ 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. Replies: 4
    Last Post: 06-22-2016, 09:04 AM
  2. [SOLVED] Divided sums of 2 columns with denominator changing based on blank values in a column
    By cujofreak in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-31-2013, 11:16 AM
  3. Calculate multiple cells sums based upon another cell
    By swiftworks in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-28-2013, 11:44 AM
  4. Replies: 1
    Last Post: 03-21-2011, 01:39 PM
  5. Subtotal according to changing number of columns
    By josnah in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-13-2008, 10:45 AM
  6. Changing the number of cells calculated
    By zealot in forum Excel General
    Replies: 8
    Last Post: 11-15-2006, 03:34 PM
  7. [SOLVED] multiple entries-sums to different cells
    By Jeff in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-21-2006, 09:00 AM

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