#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 414
Default creating formula

Hi,

I would like to know how I can create a formula. What I have is two columns
of data. I would like to have the total of the first column subtracted from
the second column. However when subtracting to start from the top of the
second column until that figure reaches 0 and then carry on with the figure
underneath. ie.

B1 = 5
B2 = 10


so if my first column A is 7 I would like the formula to subtract 7 from B1
until B1 reaches 0 and then the remaining amount to be subtracted from B2. So
this would leave 2 left over and then 10-2 would leave 8. Is there an entry I
can do this?

Many thanks.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9,101
Default creating formula

You need two formulas, not one.

in C1 put
=if(A1-B10,A1-B1,0)
in C2
=if(A1-B10,B2,B2+(A1-B1))

"Andy" wrote:

Hi,

I would like to know how I can create a formula. What I have is two columns
of data. I would like to have the total of the first column subtracted from
the second column. However when subtracting to start from the top of the
second column until that figure reaches 0 and then carry on with the figure
underneath. ie.

B1 = 5
B2 = 10


so if my first column A is 7 I would like the formula to subtract 7 from B1
until B1 reaches 0 and then the remaining amount to be subtracted from B2. So
this would leave 2 left over and then 10-2 would leave 8. Is there an entry I
can do this?

Many thanks.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 414
Default creating formula

Hi,

Thanks for your response. However this is not quite what I need. What I have
is:-
A B C
1 10 10
2 5 5
3 11
4 2
5 ttl 15 13 15

Where 5 is the total, and C is the same amount as A unless subtracted by the
total of B. Therefore after the formula the table will look like:
A B C
1 10 0
2 5 2
3 11
4 2
5 ttl 13 2

I need a formula that will start subtracting B5 from C1 until reaching 0 and
then continue with C2 and so on. Also allowing more data to be entered below
row 4.

Hope this makes sense and you can help.....

"Joel" wrote:

You need two formulas, not one.

in C1 put
=if(A1-B10,A1-B1,0)
in C2
=if(A1-B10,B2,B2+(A1-B1))

"Andy" wrote:

Hi,

I would like to know how I can create a formula. What I have is two columns
of data. I would like to have the total of the first column subtracted from
the second column. However when subtracting to start from the top of the
second column until that figure reaches 0 and then carry on with the figure
underneath. ie.

B1 = 5
B2 = 10


so if my first column A is 7 I would like the formula to subtract 7 from B1
until B1 reaches 0 and then the remaining amount to be subtracted from B2. So
this would leave 2 left over and then 10-2 would leave 8. Is there an entry I
can do this?

Many thanks.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9,101
Default creating formula

It the same formula just looking at different cells
in C1 put
=if(A1-B30,A1-B3,0)
in C2
=if(A1-B30,A2-B4,A2-B4+(A1-B3))




"Andy" wrote:

Hi,

Thanks for your response. However this is not quite what I need. What I have
is:-
A B C
1 10 10
2 5 5
3 11
4 2
5 ttl 15 13 15

Where 5 is the total, and C is the same amount as A unless subtracted by the
total of B. Therefore after the formula the table will look like:
A B C
1 10 0
2 5 2
3 11
4 2
5 ttl 13 2

I need a formula that will start subtracting B5 from C1 until reaching 0 and
then continue with C2 and so on. Also allowing more data to be entered below
row 4.

Hope this makes sense and you can help.....

"Joel" wrote:

You need two formulas, not one.

in C1 put
=if(A1-B10,A1-B1,0)
in C2
=if(A1-B10,B2,B2+(A1-B1))

"Andy" wrote:

Hi,

I would like to know how I can create a formula. What I have is two columns
of data. I would like to have the total of the first column subtracted from
the second column. However when subtracting to start from the top of the
second column until that figure reaches 0 and then carry on with the figure
underneath. ie.

B1 = 5
B2 = 10


so if my first column A is 7 I would like the formula to subtract 7 from B1
until B1 reaches 0 and then the remaining amount to be subtracted from B2. So
this would leave 2 left over and then 10-2 would leave 8. Is there an entry I
can do this?

Many thanks.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 414
Default creating formula

Hi,

Sorry for being persistent. What you have responded with is ok for the small
table in my example. However if you change the numbers it does not work eg.

A B C
1 10 1
2 5 3
3 9
4 2

I would want the C1 to display 0 and C2 to display 2. Also my table would
continue down eg.

A B C
1 10 10
2 5 5
3 3
4 4 4
5 3
6 3
7 6
8 7 7
9 2
TTL 17

So after the formula would look like:-

A B C
1 10 0
2 5 0
3 3
4 4 2
5 3
6 3
7 6
8 7 7
9 2
TTL 17

Is this any clearer??

"Joel" wrote:

It the same formula just looking at different cells
in C1 put
=if(A1-B30,A1-B3,0)
in C2
=if(A1-B30,A2-B4,A2-B4+(A1-B3))




"Andy" wrote:

Hi,

Thanks for your response. However this is not quite what I need. What I have
is:-
A B C
1 10 10
2 5 5
3 11
4 2
5 ttl 15 13 15

Where 5 is the total, and C is the same amount as A unless subtracted by the
total of B. Therefore after the formula the table will look like:
A B C
1 10 0
2 5 2
3 11
4 2
5 ttl 13 2

I need a formula that will start subtracting B5 from C1 until reaching 0 and
then continue with C2 and so on. Also allowing more data to be entered below
row 4.

Hope this makes sense and you can help.....

"Joel" wrote:

You need two formulas, not one.

in C1 put
=if(A1-B10,A1-B1,0)
in C2
=if(A1-B10,B2,B2+(A1-B1))

"Andy" wrote:

Hi,

I would like to know how I can create a formula. What I have is two columns
of data. I would like to have the total of the first column subtracted from
the second column. However when subtracting to start from the top of the
second column until that figure reaches 0 and then carry on with the figure
underneath. ie.

B1 = 5
B2 = 10


so if my first column A is 7 I would like the formula to subtract 7 from B1
until B1 reaches 0 and then the remaining amount to be subtracted from B2. So
this would leave 2 left over and then 10-2 would leave 8. Is there an entry I
can do this?

Many thanks.

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
Creating a formula!!! Tara Excel Discussion (Misc queries) 2 May 7th 07 07:27 AM
Need help with creating a formula Jodie Excel Discussion (Misc queries) 4 January 29th 07 10:33 PM
Creating a formula Pat Excel Discussion (Misc queries) 5 December 21st 06 06:59 PM
Help with creating Formula again Benny Excel Worksheet Functions 13 March 20th 05 04:59 PM
creating a formula Pamela Excel Worksheet Functions 3 February 23rd 05 07:13 PM


All times are GMT +1. The time now is 11:02 AM.

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

About Us

"It's about Microsoft Excel"