PDA

View Full Version : [SLEEPER:] Sum Till Target is Reached



phiore
05-07-2013, 07:11 AM
column A is a style number. column B has 6 values for the adjacent style number, starting in cell A2, going down the column.cell C1 has a target, lets say 100. column D, will copy over from column B the quantity in the cell B2 into D2, summing as it goes, shooting for the goal in cell C1. if after 4 numbers the sum is 95, and the value of the 5th value is 15, only 5 will be copied into column D, and the remaining 10 will go into column E. the sixth value will go into column E, because column D has reached the goal of 100, for the style. column D can only have values up to the target in cell C1, for each style in column A. all values over target in C1 move into column E, on the corresponding row. if the target is not reached, which is ok, the only values will be in column D, with nothing in column E.then the process will continue down to the next style, and the same process will repeat. the number of values per style can vary from 1 to 8 values.i would like for this to loop through all styles, till it hits the last row, in column A. thanks for any help.

phiore
05-07-2013, 11:00 AM
any thoughts to get me started. really need help on this. anything that could possibly get me going. thanks

phiore
05-09-2013, 04:27 AM
column A is a style number. column B has 6 values for the adjacent style number, starting in cell A2, going down the column.cell C1 has a target, lets say 100. column D, will copy over from column B the quantity in the cell B2 into D2, summing as it goes, shooting for the goal in cell C1. if after 4 numbers the sum is 95, and the value of the 5th value is 15, only 5 will be copied into column D, and the remaining 10 will go into column E. the sixth value will go into column E, because column D has reached the goal of 100, for the style. column D can only have values up to the target in cell C1, for each style in column A. all values over target in C1 move into column E, on the corresponding row. if the target is not reached, which is ok, the only values will be in column D, with nothing in column E.then the process will continue down to the next style, and the same process will repeat. the number of values per style can vary from 1 to 8 values.i would like for this to loop through all styles, till it hits the last row, in column A. thanks for any help.

phiore
05-09-2013, 04:28 AM
bump

mdmackillop
05-09-2013, 05:15 AM
A sample file with clear comments might get a response. I won't try to make one up based on that sort of description.

phiore
05-09-2013, 01:26 PM
A sample file with clear comments might get a response. I won't try to make one up based on that sort of description.

how best to get a sample of the sheet, online. thanks

mdmackillop
05-09-2013, 01:37 PM
Manage Attachments in Go Advanced reply

phiore
05-10-2013, 05:01 AM
ABCDEF1-target2-1003-4-5-6-grpstyleohregover7-11505008-12404009-1330102010-142502511-151501512-161001013-214545014-224040015-232015516-241001017-3111010010target is in D2. applies by grp, col A, by style, by oh. until target is hit, numbers fall into col E, after target is achieved, balance goes into col F.
once a grp changes, logic should start over as to entries into col E and col F. the target starts again. thanks for your help

phiore
05-10-2013, 05:08 AM
test target.xlsx (http://www.vbaexpress.com/forum/attachment.php?attachmentid=10013&stc=1&d=1368187677)
target is in D2. applies by grp, col A, by style, by oh. until target is hit, numbers fall into col E, after target is achieved, balance goes into col F.
once a grp changes, logic should start over as to entries into col E and col F. the target starts again. thanks for your help[/quote]

phiore
05-13-2013, 10:06 AM
bump

magelan
05-13-2013, 12:17 PM
test target.xlsx (http://www.vbaexpress.com/forum/attachment.php?attachmentid=10013&stc=1&d=1368187677)
target is in D2. applies by grp, col A, by style, by oh. until target is hit, numbers fall into col E, after target is achieved, balance goes into col F.
once a grp changes, logic should start over as to entries into col E and col F. the target starts again. thanks for your help[/quote]

if this fix doesnt work for you, i have no idea what you are trying to accomplish.