Formula to Subtract to a Limit ?

I need some way to subtract column b from column a... but I do not
want the result to go below zero. 

Ex 200-100=100
   200-300 = 0 (reached zero lower limit)  

Is there an excel formula... or perhaps some way to program a little
code to do this? If it's programming, give me a couple clues on how to
enter the code - I'm a programmer but don't know much about Excel
aside from a bit of advanced formula entry. 

Thanks, 
0
uctraing (8)
1/25/2006 5:46:30 PM
excel 39879 articles. 2 followers. Follow

3 Replies
817 Views

Similar Articles

[PageSpeed] 35

=MAX(A1-B1,0) and copy down the column
-- 
Gary''s Student


"Bob" wrote:

> I need some way to subtract column b from column a... but I do not
> want the result to go below zero. 
> 
> Ex 200-100=100
>    200-300 = 0 (reached zero lower limit)  
> 
> Is there an excel formula... or perhaps some way to program a little
> code to do this? If it's programming, give me a couple clues on how to
> enter the code - I'm a programmer but don't know much about Excel
> aside from a bit of advanced formula entry. 
> 
> Thanks, 
> 
0
GarysStudent (1572)
1/25/2006 6:06:04 PM
=B1-A1 will subtract value in A1 for value in B1
=MAX(0, B1-A1) will limit the answer to zero
=IF(B1>A1, B1-A1,0) does the same
best wishes
-- 
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Bob" <uctraing@ultranet.com> wrote in message 
news:t2eft194cbh19u7bgiijt4hke6uimp13p7@4ax.com...
>I need some way to subtract column b from column a... but I do not
> want the result to go below zero.
>
> Ex 200-100=100
>   200-300 = 0 (reached zero lower limit)
>
> Is there an excel formula... or perhaps some way to program a little
> code to do this? If it's programming, give me a couple clues on how to
> enter the code - I'm a programmer but don't know much about Excel
> aside from a bit of advanced formula entry.
>
> Thanks, 


0
bliengme5824 (3040)
1/25/2006 6:07:46 PM
On Wed, 25 Jan 2006 14:07:46 -0400, "Bernard Liengme"
<bliengme@stfx.TRUENORTH.ca> wrote:

>=B1-A1 will subtract value in A1 for value in B1
>=MAX(0, B1-A1) will limit the answer to zero
>=IF(B1>A1, B1-A1,0) does the same
>best wishes

Thanks all! 
0
uctraing (8)
1/27/2006 5:15:31 AM
Reply:

Similar Artilces: