Zero displayed in place of negative values

T

TC

Hi

I've been struggling with a couple of formulae, but am not sure if I am
going down the right route.

The first is

If value A-B is positive, return as normal. If value A-B is negative, return
zero

(Is there a simple function for this - rather than write it into a formula
?)

The second is this:

If value is => A and =< B multiply by 2, but if value is >B and =<C multiply
by 3

I'm probably just getting the syntax messed up with this one, but any help
would be much appreciated

Thanks
 
D

Dave Peterson

#1.
=max(0,a1-b1)
or
=if(a1>b1,a1-b1,0)

#2. Maybe...
=d1*if(and(D1>=a1,d1<=b1),2,if(and(d1>b1,d1<=c1),3,0))

If d1 wasn't between those two limits, then I multiplied by 0.
 
G

Guest

First ..

=MAX(0,A-B)

Second ...

=IF
(AND(value>=A1,value<=B1),value*2,IF(AND(value>B1,value<=C1),value*3,"whatever you want"))

Change 'value' as required
 

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