close

Hi,

I'm having a problem with an Excel formula containing several IFs and
ORs.

The formula looks like this (the cell references are not important
here, you can simplify it if you like, it is about the structure of
this whole expression in which there must be an error that causes it
not to yield the results that I want):

In one line:
=IF(C21lt;$C$62,quot;Absentquot;,IF(OR(B23=quot;Absentquot;,C21lt;$C$6 2),IF(OR(C21/B21lt;2,ABS(-1/(C21/B21))lt;2),quot;*quot;,IF(OR(C21/B21lt;3,ABS(-1/(C21/B21))lt;3),quot;**quot;,IF(OR(C21/B21lt;4,ABS(-1/(C21/B21))lt;4),quot;***quot;,IF(OR(C21/B21gt;=4,ABS(-1/(C21/B21))gt;=4),quot;****quot;,quot;Xquot;))))))

In a somewhat more structured format:
=IF(C21lt;$C$62,
quot;Absentquot;,
IF(OR(B23=quot;Absentquot;,C21lt;$C$62),
IF(OR(C21/B21lt;2,ABS(-1/(C21/B21))lt;2),
quot;*quot;,
IF(OR(C21/B21lt;3,ABS(-1/(C21/B21))lt;3),
quot;**quot;,
IF(OR(C21/B21lt;4,ABS(-1/(C21/B21))lt;4),
quot;***quot;,
IF(OR(C21/B21gt;=4,ABS(-1/(C21/B21))gt;=4),
quot;****quot;,
quot;Xquot;))))))What I would like this formula to do is this:

If the first condition (he C21lt;$C$62) is true, then I want quot;Absentquot;
to be displayed. This works.

If the subsequent OR condition (he OR(B23=quot;Absentquot;,C21lt;$C$62) ) is
true, then I want 1, 2, 3, or 4 asterisks to be displayed depending on
the other four OR conditions. This also works.

If the condition OR(B23=quot;Absentquot;,C21lt;$C$62) is false, I want X to be
displayed (actually, X is another expression but for simplicity's sake
I just call it X here). However, this does not work. Instead, I get
FALSE instead of X.

I can't see the mistake. Could anyone help me make the formula do want
I want it to?

Regards,
Peter


Frank

I am no formula expert but 2 things that stand out to me are

IF(OR(B23=quot;Absentquot;,C21lt;$C$6 2)
should probally be
IF(OR(B23=quot;Absentquot;,C21lt;$C$62)

and also with this part of the formula you list only one result action
IF(OR(B23=quot;Absentquot;,C21lt;$C$6 2), do another if statement, no action
listed)Try This

=IF(C21lt;$C$62,
quot;Absentquot;,IF(OR(B23=quot;Absentquot;,C21lt;$C$62),IF(OR(C 21/B21lt;2,ABS(-1/(C21/B21))lt;2),quot;*quot;,IF(OR(C21/B21lt;3,ABS(-1/(C21/B21))lt;3),quot;**quot;,IF(OR(C21/B21lt;4,ABS(-1/(C21/B21))lt;4),quot;***quot;,IF(OR(C21/B21gt;=4,ABS(-1/(C21/B21))gt;=4),quot;****quot;,quot;Xquot;)))),quot;Missing
Value Goes Herequot;))

or=IF(C21lt;$C$62,
quot;Absentquot;,IF(OR(B23=quot;Absentquot;,C21lt;$C$62),quot;Missin g Value Goes
Herequot;,IF(OR(C21/B21lt;2,ABS(-1/(C21/B21))lt;2),quot;*quot;,IF(OR(C21/B21lt;3,ABS(-1/(C21/B21))lt;3),quot;**quot;,IF(OR(C21/B21lt;4,ABS(-1/(C21/B21))lt;4),quot;***quot;,IF(OR(C21/B21gt;=4,ABS(-1/(C21/B21))gt;=4),quot;****quot;,quot;Xquot;))))))--
mudraker
------------------------------------------------------------------------
mudraker's Profile: www.excelforum.com/member.php...foamp;userid=2473
View this thread: www.excelforum.com/showthread...hreadid=523337I think you have your teminating brackets in the wrong place for your
logic - it should be:

=IF(C21lt;$C$62,quot;Absentquot;,
IF(OR(B23=quot;Absentquot;,C21lt;$C$62),
IF(OR(C21/B21lt;2,ABS(-1/(C21/B21))lt;2),quot;*quot;,
IF(OR(C21/B21lt;3,ABS(-1/(C21/B21))lt;3),quot;**quot;,
IF(OR(C21/B21lt;4,ABS(-1/(C21/B21))lt;4),quot;***quot;,
IF(OR(C21/B21gt;=4,ABS(-1/(C21/B21))gt;=4),quot;****quot;)))),
quot;Xquot;))Pete_UK wrote:

gt;I think you have your teminating brackets in the wrong place for your
gt;logic - it should be:
gt;
gt;=IF(C21lt;$C$62,quot;Absentquot;,
gt;IF(OR(B23=quot;Absentquot;,C21lt;$C$62),
gt;IF(OR(C21/B21lt;2,ABS(-1/(C21/B21))lt;2),quot;*quot;,
gt;IF(OR(C21/B21lt;3,ABS(-1/(C21/B21))lt;3),quot;**quot;,
gt;IF(OR(C21/B21lt;4,ABS(-1/(C21/B21))lt;4),quot;***quot;,
gt;IF(OR(C21/B21gt;=4,ABS(-1/(C21/B21))gt;=4),quot;****quot;)))),
gt;quot;Xquot;))

Yep, that was it. Now the formula works correctly. Thanks.

Peter

Thanks for feeding back.

Pete

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()