1

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

3
  • 2
    This is not the valid way how to use NOT and OR as those are "functions()" ... Go read over it again Commented Oct 30, 2018 at 8:19
  • Thanks for correction. Can you please give some hint. Commented Oct 30, 2018 at 8:22
  • If I want to implemet != ad || in excel how I achieve it? Commented Oct 30, 2018 at 8:24

2 Answers 2

2

The OR syntax is ... OR(<condition1>, <condition2>) and NOT is ...NOT(<condition1>).... Try,

=if(NOT(c10="SA"), if(OR(h10="L1", h10="L2"), if(NOT(i10 = "A"), "ERROR!", if(j10 = "2", "ERROR!", CONCAT(c10:k10))), "ERROR!"), "ERROR!")
Sign up to request clarification or add additional context in comments.

Comments

2

Here is my attempt at your formula:

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

In Excel, both OR and NOT are actual functions, not operators. OR takes two boolean expressions being compared and returns a boolean output. NOT takes a single boolean expression and returns a boolean output.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.