No value less than 0

S

Steven

How can I constrain a simple A-B calculation to not
display negative numbers? I am trying to gauge customer
resupply levels but the negative numbers are messing up
the totals. Thanks.
 
H

Harald Staff

=(A1-B1)*(A1>B1)
=MAX(A1-B1,0)
=IF(A1>B1,A1-B1,0)

Note that these will actually return zero , not just contain negative values
and display zero. Hope that's what you want.
 
A

Anon

Steven said:
How can I constrain a simple A-B calculation to not
display negative numbers? I am trying to gauge customer
resupply levels but the negative numbers are messing up
the totals. Thanks.

Instead of
=A1-B1
you could use
=MAX(A1-B1,0)
Any negative difference would then result in 0 instead.
Is this what you need?
 
B

barb

-----Original Message-----
How can I constrain a simple A-B calculation to not
display negative numbers? I am trying to gauge customer
resupply levels but the negative numbers are messing up
the totals. Thanks.
.

type: =if(sum(A-B)<0,0,(A-B))
 
S

Steven

Thanks! That fixed it.
-----Original Message-----
Steven, will this work? =IF(A1-B1<0,0,A1-B1)

--
Paul B
Always backup your data before trying something new
Using Excel 2000 & 97
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **



.
 
L

Ledu

Using your example
=IF(A-B<0,0,A-B)
Should be
=IF(A1-B1<0,0,A1-B1)
This will enter a 0 for any negative number into the column
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top