Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Andman
 
Posts: n/a
Default Sum of row until you reach a certain amount

I want to add columns A2 through P2 until it equals the total in cell A1
Once the total would be met it would zero out the remainder of the cells.

For Example:

Cell A1 = 30
Cell A2 = 14
Cell B2 = 15
Cell C2 = 16
Cell D2 = 17 etc. (All the way to P2 which equals 29)

In the end I need:
Cell A3 to equal 14
Cell B3 to equal 29, (A2+B2) But we still need to add as we have not reached
30.
Cell C3 to equal 30, (A2+B2+C2) Because we only need 1 more to total to 30
Cells D4 to P4 to equal 0 as we have equaled or matched Cell A1 which is 30

I hope you can help!

Andman

  #2   Report Post  
JulieD
 
Posts: n/a
Default

Hi Andman

assuming D4:P4 to equal 0 was a typo and you meant D3:P3
the formula you need are
in A3
=A2
in B3
=IF(SUM($A$2:A2)=$A$1,0,MIN(B2+A3,$A$1))
and fill across to P3

Cheers
JulieD

"Andman" wrote in message
...
I want to add columns A2 through P2 until it equals the total in cell A1
Once the total would be met it would zero out the remainder of the cells.

For Example:

Cell A1 = 30
Cell A2 = 14
Cell B2 = 15
Cell C2 = 16
Cell D2 = 17 etc. (All the way to P2 which equals 29)

In the end I need:
Cell A3 to equal 14
Cell B3 to equal 29, (A2+B2) But we still need to add as we have not
reached
30.
Cell C3 to equal 30, (A2+B2+C2) Because we only need 1 more to total to 30
Cells D4 to P4 to equal 0 as we have equaled or matched Cell A1 which is
30

I hope you can help!

Andman



  #3   Report Post  
Andman
 
Posts: n/a
Default

You deserve a thousand gold stars!

Thank you very much!

A

"JulieD" wrote:

Hi Andman

assuming D4:P4 to equal 0 was a typo and you meant D3:P3
the formula you need are
in A3
=A2
in B3
=IF(SUM($A$2:A2)=$A$1,0,MIN(B2+A3,$A$1))
and fill across to P3

Cheers
JulieD

"Andman" wrote in message
...
I want to add columns A2 through P2 until it equals the total in cell A1
Once the total would be met it would zero out the remainder of the cells.

For Example:

Cell A1 = 30
Cell A2 = 14
Cell B2 = 15
Cell C2 = 16
Cell D2 = 17 etc. (All the way to P2 which equals 29)

In the end I need:
Cell A3 to equal 14
Cell B3 to equal 29, (A2+B2) But we still need to add as we have not
reached
30.
Cell C3 to equal 30, (A2+B2+C2) Because we only need 1 more to total to 30
Cells D4 to P4 to equal 0 as we have equaled or matched Cell A1 which is
30

I hope you can help!

Andman




  #4   Report Post  
JulieD
 
Posts: n/a
Default

you're welcome <vbg thanks for the feedback

"Andman" wrote in message
...
You deserve a thousand gold stars!

Thank you very much!

A

"JulieD" wrote:

Hi Andman

assuming D4:P4 to equal 0 was a typo and you meant D3:P3
the formula you need are
in A3
=A2
in B3
=IF(SUM($A$2:A2)=$A$1,0,MIN(B2+A3,$A$1))
and fill across to P3

Cheers
JulieD

"Andman" wrote in message
...
I want to add columns A2 through P2 until it equals the total in cell A1
Once the total would be met it would zero out the remainder of the
cells.

For Example:

Cell A1 = 30
Cell A2 = 14
Cell B2 = 15
Cell C2 = 16
Cell D2 = 17 etc. (All the way to P2 which equals 29)

In the end I need:
Cell A3 to equal 14
Cell B3 to equal 29, (A2+B2) But we still need to add as we have not
reached
30.
Cell C3 to equal 30, (A2+B2+C2) Because we only need 1 more to total to
30
Cells D4 to P4 to equal 0 as we have equaled or matched Cell A1 which
is
30

I hope you can help!

Andman






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to add 6% sales tax to the amount in a cell/column Bobb1220 Excel Discussion (Misc queries) 3 March 12th 05 01:58 PM
Pivot table hidding zeros in sum of amount nc Excel Discussion (Misc queries) 0 February 7th 05 12:29 PM
How do I enter a negative dollar amount? CML Excel Discussion (Misc queries) 7 February 6th 05 11:19 PM
To find a combination of numbers that equal a set amount? Larry Morris Excel Discussion (Misc queries) 6 December 17th 04 05:39 PM
Loan Amortization Template - Amount of Final Payment Glenn Excel Discussion (Misc queries) 0 December 11th 04 01:05 AM


All times are GMT +1. The time now is 05:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"