Excel中是否为多个

时间:2018-10-30 08:18:14

标签: excel

我想用Excel编写公式。我想在excel中实现以下

if(C10 != "SA")
{
    if(H10 == L1 OR H10 == L2)
    {
        if(I10 != "A")
        {
            ERROR
        }
        else
        {
            if(J10 == "2")
            {
                Concate
            }
            else
            {
                ERROR
            }
        }
    }
    else
    {
        ERROR
    }   
}
else
{
    ERROR   
}

然后我在excel中写下面的公式

=if(NOT c10 = "SA",if(h10 = "L1" OR h10 = "L2",if(NOT i10 = "A","ERROR!",if(j10 = "2","ERROR!",CONCAT(c10:k10))),"ERROR!"),"ERROR!")

但是当我输入公式时,它给了我错误

enter image description here

请帮助我解决问题。预先感谢

2 个答案:

答案 0 :(得分:2)

这是我尝试您的公式:

IF(NOT(C10="SA"), IF(OR(H10=L1,H10=L2), IF(I10="A",
    IF(J10="2",CONCAT(c10:k10), "ERROR"), "ERROR"), "ERROR"), "ERROR")

在Excel中,ORNOT都是实际函数,而不是运算符。 OR接受两个布尔表达式进行比较并返回布尔输出。 NOT接受一个布尔表达式并返回布尔输出。

答案 1 :(得分:2)

OR语法为...NOT(<condition1>)...,而不是=if(NOT(c10="SA"), if(OR(h10="L1", h10="L2"), if(NOT(i10 = "A"), "ERROR!", if(j10 = "2", "ERROR!", CONCAT(c10:k10))), "ERROR!"), "ERROR!") 。试试

<div id="logoutModal" bsModal #myModal="bs-modal" class="modal" 
tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria- 
hidden="true" >
    <div class="modal-dialog modal-lg modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title" id="myModalLabel">Sign Out</h4>
                <button type="button" class="close" data-dismiss="modal" 
aria-hidden="true" aria-label="Close">×</button>
            </div>
            <div class="modal-body">
                <p><i class="fa fa-question-circle"></i> Are you sure you 
want to sign out? <br /></p>
            </div>
            <div class="modal-footer text-center">
                    <button class="btn btn-default btn-primary" data- 
dismiss="modal" (click)="confirmSignOut()">Sign out</button>
                    <button class="btn btn-default" data- 
dismiss="modal">Cancel</button>
            </div>
        </div>
    </div>
</div>