+ Reply to Thread
Results 1 to 4 of 4

Sum the Values in a Column until a set Sum is reached (<=), and restart Sum automatically

  1. #1
    Registered User
    Join Date
    04-17-2017
    Location
    Kansas
    MS-Off Ver
    2013
    Posts
    2

    Sum the Values in a Column until a set Sum is reached (<=), and restart Sum automatically

    I have hundreds of shelves of a set width value (144") and thousands of SKU's of varying widths that I need to place on each shelf. I can leave some empty space on a shelf, but nothing can "hang" off a shelf.

    Note that there are Rows with a value of 0, since that item will be comingled in box with an adjacent item (see table)

    I have tried Indirect, Address and Row and several other functions but the solution evades me.
    In columnA I have item widths and in ColumnB I have the sum I am hoping to obtain that is less than 144". When <=144 occurs I want to execute a SUM, and restart the Sum Function.

    Thank you in advance for reading this, and I will appreciate any help you can provide.


    ColA ColB
    17.75
    17.75
    17.75
    23.375
    0
    17.75
    17.75
    17.75 129.875
    17.75
    17.75
    23.375
    0
    0
    14
    14
    14
    14
    17.75 132.625
    17.75
    17.75
    23.375
    0
    17.75
    17.75
    17.75
    23.375
    0
    0 135.5
    14
    14
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,819

    Re: Sum the Values in a Column until a set Sum is reached (<=), and restart Sum automatica

    I put this formula in C2, so that you can compare it directly with your manual results in column B:

    =IF(SUM(A$2:A3)-SUM(C$1:C1)>=144,SUM(A$2:A2)-SUM(C$1:C1),"")

    Copy the formula down.

    Hope this helps.

    Pete

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Sum the Values in a Column until a set Sum is reached (<=), and restart Sum automatica

    Mine is more complicated than Pete's so go with Pete's unless there are issues.

    I inserted a blank row 2, then put 10 into B2. I then hid row 2

    In B3 copied down
    =IF(SUM(INDEX($A$2:$A3, MATCH(999,$B$2:$B2)+1):$A4)>144, SUM(INDEX($A$2:$A3, MATCH(999, $B$2:$B2)+1):A3),"")
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    04-17-2017
    Location
    Kansas
    MS-Off Ver
    2013
    Posts
    2

    Re: Sum the Values in a Column until a set Sum is reached (<=), and restart Sum automatica

    Chemist B,

    Thank you for you solution as well... I am going to deploy its well as a learning experience. Thank you!!
    Bob

+ 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. restart counting once integer reached
    By wbsgn12 in forum Excel General
    Replies: 3
    Last Post: 07-30-2016, 02:10 PM
  2. [SOLVED] Replacing Column Values until blank cell reached
    By Mokaman10 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2016, 11:39 PM
  3. automatically restart formulas when col reaches positve
    By gilnic in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-23-2015, 07:56 AM
  4. Can Excel automatically add 1 to previous cell until # is reached?
    By todd774 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 06-10-2013, 05:01 PM
  5. [SOLVED] Restart and increment numbers in column based on changed value in adjacent column
    By Kespin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-03-2013, 06:26 PM
  6. [SOLVED] have values in column change color after a certain total is reached
    By patrickmcdiver in forum Excel General
    Replies: 9
    Last Post: 04-24-2012, 09:29 AM
  7. Replies: 1
    Last Post: 04-24-2012, 12:17 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