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

I have cell A1 which equals 12000.

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.

How do I do that?

Thanks for the help!
And
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

=MIN(A1,SUM(A2:P2)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andman" wrote in message
...
I have cell A1 which equals 12000.

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.

How do I do that?

Thanks for the help!
And



  #3   Report Post  
Andman
 
Posts: n/a
Default

Ok, I need to take this one step further.

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
Cell D4 to P4 to equal 0 as we have equaled or matched Cell A1 which is 30

I hope you can help!

Andman

"Bob Phillips" wrote:

=MIN(A1,SUM(A2:P2)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andman" wrote in message
...
I have cell A1 which equals 12000.

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.

How do I do that?

Thanks for the help!
And




  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

In A3 put =A2

In B3, put =IF(COLUMN()=1,B2,IF(OR(A3=$A$1,A3=0),0,MIN($A$1,S UM($A$2:B2))))

copy B3 across to P3

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andman" wrote in message
...
Ok, I need to take this one step further.

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
Cell D4 to P4 to equal 0 as we have equaled or matched Cell A1 which is 30

I hope you can help!

Andman

"Bob Phillips" wrote:

=MIN(A1,SUM(A2:P2)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andman" wrote in message
...
I have cell A1 which equals 12000.

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.

How do I do that?

Thanks for the help!
And






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
print excel columns on less pages a_ryan1972 Excel Discussion (Misc queries) 1 February 9th 05 05:41 PM
Columns in Excel will not allow user to click in them Kim Excel Discussion (Misc queries) 1 December 28th 04 06:37 PM
Counting the Contents of Two Columns Molochi Excel Discussion (Misc queries) 6 December 22nd 04 08:13 PM
Averaging columns rhodesv New Users to Excel 1 December 16th 04 08:14 PM
combining 3 columns of same info for a pivot table Julie Excel Worksheet Functions 0 December 15th 04 03:12 PM


All times are GMT +1. The time now is 12:01 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"