首页 > 解决方案 > Multiple If Else in Excel

问题描述

I want to write a formula in excel. I want to implement below in 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   
}

And I write below formula in 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!")

But it gives me error when I enter a formula

enter image description here

Please help me to solve the issue. Advance thanks

标签: excel

解决方案


OR 语法是... OR(<condition1>, <condition2>)而不是...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!")

推荐阅读