Explaination of Logical If Then Statement

M

Mitchell

Can anyone explain to me why the following logical statement has the AND
placed at the very beginning of the statement?

=IF(AND($E964="",I964=""),"",IF($E964="",I964,IF($G964="",I964,MROUND(I964,$G964))))
 
J

John C

there are 3 arguments to an IF statement, the argument, what to do if true,
and what to do if false.

the AND portion of this formula is your argument.

in order to display "" (nothing) the argument must be true, in order for the
argument to be true, both tests must be true (since AND, if OR were used,
only 1 of them would need to be true). The tests are $E964="" and I964="", so
if both are blank, then the first IF is TRUE, displays "" (nothing) and is
done.
 
M

Mike H

Hi

Its doing this

=IF(AND($E964="",I964=""),"",
if both these cell are empty do nothing

IF($E964="",I964
if E964 is empty return I964

IF($G964="",I964
if G964 is empty return I964

MROUND(I964,$G964))))
If none of the above are tru round I964 to the nearets multiple of G964


Why is another question

Mike
 
J

jayray

Can anyone explain to me why the following logical statement has the AND
placed at the very beginning of the statement?

=IF(AND($E964="",I964=""),"",IF($E964="",I964,IF($G964="",I964,MROUND(I964,$G964))))

It's to tell Excel to get to the answer quickly that if both $E964 and
I964 are "", then return a "" and don't bother figuring the rest of
the formula.
 

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