Formula to Subtract to a Limit ?

B

Bob

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,
 
B

Bernard Liengme

=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
 
Top