Link to home
Start Free TrialLog in
Avatar of finnstone
finnstone

asked on

vba code almost working, just needs one edit to look at one column to left of where it looks

need a code script modified.

you will see in the attached that the formula is summing the wrong columns. it is supposed to look for when the array crosses 215,000 of the sum of the preceding columns, then take the sum of all of the next columns . for some reason it starts an n+1, n+2 instead of summing n,n+1,n+2...i.e. it skips the cell immediately following the cell where threshold was crossed.
RunningSumTestingQ29115305-SUMMING-.xlsm
ASKER CERTIFIED SOLUTION
Avatar of byundt
byundt
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Look at formula for cell G34 in the attached workbook.
=RunningSum(H34:CA34,12,12,215000,2)            'Sums K34:N34
=RunningSum(H34:CA34,12,12,215000,1)                 'Sums J34:N34

Open in new window

The only difference between these two formulas is value of last parameter.