if formula return true value

T

Theresa

How can I get an if formula to return the difference of two cells but not
more than the value of another cell?
 
D

Dave Peterson

=max(a1,b1-c1)
or maybe
=max(a1,abs(b1-c1))

b1 and c1 are the two cells to compare.
A1 is the cell not to exceed.
 
B

Bill Kuunders

something like =IF((A1-B1)<=C1,A1-B1,C1)

or in plain english ............. If A1-B1 is smaller or equal than C1
display the result of A1-B1
otherwise display the contents of C1

assuming A1 is always larger than B1

if not you may have to have an "absoluut" condition in the function

=IF(ABS(A2-B2)<=C2,ABS(A2-B2),C2)
 
D

Dave Peterson

Thanks for the correction, David.

David said:
I think you may have intended MIN rather than MAX, Dave?

It always seems strange that to limit a formula to a maximum value one uses
the MIN function, so my mental agility sometimes struggles with the problem.
:)
 

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