IF worksheet functon

J

JD

I have a couple of if statements nested. Is there a way
the exit the function as soon as the condition is met? If
the cell I am comparing matches more than one of my
conditions then the last condition prevails.
 
R

RagDyer

You should post your formula, because what you're saying is *not* correct,
as you state the situation.

For example, this *bad* formula:

=IF(A1>10,"OK",IF(A1>20,"NO GOOD","EMPTY"))

would return the *first* arguments result (OK), even though A1 contained
100.
That's because, the IF function *stops* calculation after an argument is
satisfied.
Even though A1 contains 100, which is greater then 20 (>20), it (the IF()
function) never gets to even evaluate the >20, because, since 100 is *also*
greter then 10, that satisfied the first argument and therefore *stopped*
any further calculations, and returned the first arguments result (OK).
--


Regards,

RD
--------------------------------------------------------------------
Please keep all correspondence within the Group, so all may benefit!
-------------------------------------------------------------------


I have a couple of if statements nested. Is there a way
the exit the function as soon as the condition is met? If
the cell I am comparing matches more than one of my
conditions then the last condition prevails.
 
B

Bob Phillips

=IF(cond1,action1,IF(cond2, action2,action3))

should follow action 1 if cond1 is met.

What is your formula?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
J

JD

I was using
=if(cond1,value1,if(cond2,value2,if(cond3,value3,value4)))

but if a cell meets cond1 & cond2, value2 will be returned
but I want value1.
 
A

Aladin Akyurek

JD said:
I was using
=if(cond1,value1,if(cond2,value2,if(cond3,value3,value4)))

but if a cell meets cond1 & cond2, value2 will be returned
but I want value1.

When cond1 evaluates to TRUE, you'll get value1. If that's not the case, you
could post the real formula that you use.
 

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