If statement - simple problems

R

rition

I have been trying to create my first if statement without success
please could someone put me out of my misery.

I have two columns with figures in and in column 3 I wish to enter the
difference if stock on hand is less than stock needed but if the stock
is more than needed I wish to enter zero

Example

Stock needed stock on hand Order

100 25 75(the formula would
calculate
difference and enter 75)

300 301 currently my formula is
entering -1 but I want it
to enter 0

TIA
 
B

Bob Phillips

=IF(A1>A2,A1-A2,0)

and just copy down

--

HTH

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

Ragdyer

ColA = Needed
ColB = On Hand

Enter in C2:

=MAX(A2-B2,0)

And copy down as needed.
 
B

Biff

Hi!

Try this:

=IF(stock_on_hand<stock_needed,stock_needed-stock_on_hand,0)

=IF(B2<A2,A2-B2,0)

Biff
 
Top