ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Caculating the remainding amount (https://www.excelbanter.com/new-users-excel/354950-caculating-remainding-amount.html)

bob__

Caculating the remainding amount
 
Hi everyone.

First time poster here, but i have read through alot of threads and i cant seem to find an answer that can help me, so i thought i join up and become an active member :)

Ill cut straight to the point

I am at an intermediate level with excel, and i was wondering if my following problem can be solved, ill give a basic run-down, and if anymore detail is required please let me know

After a few caculations etc etc i have 2 cells left that i need to get the following to happen

I will call them A and B

A has an amount which could be negative or positive.
B always starts with 3000 (could be 4000 or anything else later on, but for all purposes 3000 is fine)

Is there a way so that if A is ever a negative, i can have an amount taken from B to bring A back to zero.

If A is positive, nothing would be done, but if A was -345.32 for example, that exact amount is taken from B

That is the most direct description i can give, but if more info is reequired just let me know, because there possibly might be a way around this with another column or two to bypass this

And help would be great

Thanks in advance

joeu2004[_2_]

Caculating the remainding amount
 
"bob__" wrote:
First time poster here

[....]
i have 2 cells left that i need to get
I will call them A and B


So for your edification as a newbie here, it is better to call them what
they are (e.g. A1 and B1).

And it is prudent to show exactly the formulas or constant that each cell
contains in order to minimize ambiguities that delay your getting a usable
answer.

Bob wrote:
B always starts with 3000 (could be 4000 or anything
else later on, but for all purposes 3000 is fine)

[....]
If A is positive, nothing would be done, but if A
was -345.32 for example, that exact amount is taken
from B


Perhaps the following in B1:

=MIN(3000,3000+A1)

or

=MAX(0,MIN(3000,3000+A1))

The difference depends on whether or not you want to allow B1 to go negative
(A1 < - 3000).


Stan Brown

Caculating the remainding amount
 
On Sat, 28 Jan 2012 11:11:21 +0000, bob__ wrote:

A has an amount which could be negative or positive.
B always starts with 3000 (could be 4000 or anything else later on, but
for all purposes 3000 is fine)

Is there a way so that if A is ever a negative, i can have an amount
taken from B to bring A back to zero.

If A is positive, nothing would be done, but if A was -345.32 for
example, that exact amount is taken from B


In B1:

=3000+min(0,A1)

If A1 is negative, min(0,A1) is A1, and that negative amount will be
added to B1, or in other words B1 will be reduced.

If A1 is positive (or 0), min(0,A1) is 0, an dB1 will be 3000.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com
Shikata ga nai...


All times are GMT +1. The time now is 09:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com