• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to add up only necessary numbers until desired target is achieved.

moaz

New Member
Hi

I have been trying to add up numbers (in Column B) from a series (Column A); until the sum of added numbers have an exact match with a specific target (Cell E2).

P.S. I need to add only the necessary numbers so that the sum doesn't exceed or fall short of the target.

To clarify my requirement, I have shown cumulative sums of the series in Column C; where it shows why the red colored numbers of the series did not add up in the Column B.

1716569268077.png

Thanks in advance!
 
Last edited:

moaz

cell B1 =IF(A1<=E$2,A1,"")
cell C1 =SUM(B$1:B1) and copy down
cell B2 =IF(C1+A2<=E$2,A2,"") and copy down
... You could solve those reds ... if You really need those.
 
Back
Top