IF functions

J

JohnnyJomp

Hi there:
Can someone help me with a formula using IF? I want to subtract one cell
from another, and if the result is a negative number, I want the answer to be
0.
Would it also be possible to add one more IF? If the answer to the above is
less than 4, I want to multiply it by 1.5; if it is more than 4, multiply by
2.

Is it possible???
Thanks in advance!
John
 
J

JE McGimpsey

One way:

=MAX(0,A2-A1)*(2-((A2-A1)<4)/2)

Or, if you must have it using IF:

=IF((A2-A1)<0,0,(A2-A1)*IF((A2-A1)<4,1.5,2))
 
J

JohnnyJomp

Well, that is a good point that I did not make clear!
But I think the next post has my answer. I decided in the
mean time that I did not really need the 1.5 and 2 times
functions...
John
 
J

JohnnyJomp

Hi!
Thanks for the reply. I will try it and get back to you.
Thanks again for the tip...
John

-----Original Message-----
One way:

=MAX(0,A2-A1)*(2-((A2-A1)<4)/2)

Or, if you must have it using IF:

=IF((A2-A1)<0,0,(A2-A1)*IF((A2-A1)<4,1.5,2))
 

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