+ Reply to Thread
Results 1 to 15 of 15

SUM for unknown number of set of rows

  1. #1
    Registered User
    Join Date
    12-27-2016
    Location
    Milpitas, California
    MS-Off Ver
    2013
    Posts
    7

    SUM for unknown number of set of rows

    Dear all,

    I've had searched the forum but couldn't locate the solution for my situation.

    Situation: Huge amount of data. Set of unknown number of rows, e.g one set has 6 rows, 10 row, 14 rows, etc. Each set is separated by a row containing blank and date. How can I define a formula so that I can quickly sum values. Please see the screenshot below.

    Excel_1.PNG



    It would be a night mare if I manually enter the sum formula for 1 million records like that. Any help is appreciated !

    Regards,
    AL

    8
    Attached Files Attached Files
    Last edited by California4jx; 12-27-2016 at 04:48 PM.

  2. #2
    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,926

    Re: SUM for unknown number of set of rows

    Hi, welcome to the forum

    Please upload a sample of your workbook, not a picture of your data. Pictures are pretty much impossible to edit, and no-one wants to re-type your data for you
    Also, not all members can upload picture files (Company firewalls and stuff) - and, depending on what browser is being used, some pics dont even show up on the forum

    Your workbook should show a small desensitized example of the data you are working with and a manual mockup of the expected results.

    (dont forget the sample answers)
    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

  3. #3
    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,926

    Re: SUM for unknown number of set of rows

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.

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

    Re: SUM for unknown number of set of rows

    I can't see your image.

    One way...

    Data Range
    E
    F
    1
    61
    2
    10
    3
    81
    4
    152
    5
    22
    6
    52
    7
    74
    8
    82
    9
    82
    10
    86
    11
    93
    12
    55
    13
    27
    14
    261
    15
    ------
    ------


    This formula entered in F2 and copied down:

    =IF(E2="",SUM(E$1:E2)-SUM(F$1:F1),"")

    If you really do have a million rows worth of data this may be slow to calculate.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    12-27-2016
    Location
    Milpitas, California
    MS-Off Ver
    2013
    Posts
    7

    Re: SUM for unknown number of set of rows

    Quote Originally Posted by FDibbins View Post
    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    Thanks for the guidance - just uploaded the sample file

  6. #6
    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,926

    Re: SUM for unknown number of set of rows

    Thanks for the file.

    (looks like you forgot the sample answers?)

    Did you try Tony's suggestion yet?

  7. #7
    Registered User
    Join Date
    12-27-2016
    Location
    Milpitas, California
    MS-Off Ver
    2013
    Posts
    7

    Re: SUM for unknown number of set of rows

    Quote Originally Posted by FDibbins View Post
    Thanks for the file.

    (looks like you forgot the sample answers?)

    Did you try Tony's suggestion yet?
    working on it ...

  8. #8
    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,926

    Re: SUM for unknown number of set of rows

    On the suggestion - or including sample answers - or both?
    lol

  9. #9
    Registered User
    Join Date
    12-27-2016
    Location
    Milpitas, California
    MS-Off Ver
    2013
    Posts
    7

    Re: SUM for unknown number of set of rows

    Quote Originally Posted by Tony Valko View Post
    I can't see your image.

    One way...

    Data Range
    E
    F
    1
    61
    2
    10
    3
    81
    4
    152
    5
    22
    6
    52
    7
    74
    8
    82
    9
    82
    10
    86
    11
    93
    12
    55
    13
    27
    14
    261
    15
    ------
    ------


    This formula entered in F2 and copied down:

    =IF(E2="",SUM(E$1:E2)-SUM(F$1:F1),"")

    If you really do have a million rows worth of data this may be slow to calculate.
    Dear Tony,

    You are genius ! It works like a charm ! :-)

    Thank you so much for your help. You saved me tons of time. As far as the amount of data, it's not literally million, it's in thousands.

    Happy Holidays and New Year !

    Warm Regards,
    Al

  10. #10
    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,926

    Re: SUM for unknown number of set of rows

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  11. #11
    Registered User
    Join Date
    12-27-2016
    Location
    Milpitas, California
    MS-Off Ver
    2013
    Posts
    7

    Re: SUM for unknown number of set of rows

    Hey Ford,

    both :-) Just finished the suggestion - working like a charm. Also uploaded the example file with Tony's suggested formula and the resulting answers. It's awesome !

    You've a great happy holidays and new year !

    Regards,
    Al

  12. #12
    Registered User
    Join Date
    12-27-2016
    Location
    Milpitas, California
    MS-Off Ver
    2013
    Posts
    7

    Re: SUM for unknown number of set of rows

    You are one step ahead of me. Yes, I tried to give him star but it says something about the points. I clicked twice - not sure it went through to him. I am marking this as solved now. Thanks again for guidance.

  13. #13
    Registered User
    Join Date
    12-27-2016
    Location
    Milpitas, California
    MS-Off Ver
    2013
    Posts
    7

    Re: SUM for unknown number of set of rows

    Biff,

    Thanks for the awesome solution ! You rock!

    Regards,
    Al

  14. #14
    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,926

    Re: SUM for unknown number of set of rows

    Good stuff, thanks for the feedback

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

    Re: SUM for unknown number of set of rows

    You're welcome. Thanks for the feedback!

+ 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. Auto Fill for unknown number of rows...
    By jlworden in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-10-2013, 12:41 PM
  2. Sum 12 Rows Unknown Number Of Columns
    By goss in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-28-2012, 08:34 AM
  3. Basing a formula on an unknown number of rows
    By LilyB in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-24-2012, 01:24 PM
  4. Loop to Sum Unknown Number of Rows
    By DBExhale in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-15-2010, 07:19 AM
  5. Sum of Unknown Number of Rows
    By Colin_S in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-12-2010, 11:27 AM
  6. Replies: 4
    Last Post: 08-02-2010, 04:26 PM
  7. combining worksheets with unknown number of rows
    By smokebreak in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-16-2009, 06:12 PM
  8. sum up an unknown number of rows
    By skoller in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-12-2006, 07:33 PM

Tags for this Thread

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