DEV Community

Andrews
Andrews

Posted on • Originally published at geekexcel.com on

Excel Formulas to Test If a Cell Value is (X or Y) and Z!!

Normally, the IF statement helps to test a condition and to return one value if the condition is met, and another value if the condition is not met. In this article, we are going to learn the simple formula to test the cell value with more logical functions like (x OR y) AND z in Excel. Let’s get into this article!! Get an official version of ** MS Excel** from the following link: https://www.microsoft.com/en-in/microsoft-365/excel

If cell is x or y and z
If the cell is x or y and z

Generic Formula:

  • Use the below formula to test the cells with more complex logic.

=IF(AND(OR(A1=x,A1=y),B1=z),”yes”,”no”)

Syntax Explanations:

  • IF – In Excel, the IF function helps to return one value for a TRUE result, and another for a FALSE result.
  • AND – The AND Function checks multiple Conditions and returns **TRUE **if all the conditions are evaluated as true otherwise returns FALSE.
  • OR – It is a logical function to test multiple conditions at the same time. The OR Function helps to return either TRUE or FALSE.
  • A1, B1 – It is the input data from your worksheet.
  • Comma symbol (,) – It is a separator that helps to separate a list of values.
  • Parenthesis () – The main purpose of this symbol is to group the elements.

Practical Example:

Let’s see the below example.

  • First, we will enter the input values in Column B to Column D.

Input Ranges
Input Ranges

  • Here, we are going to declare the result based on their scores and grades.
  • Apply the above-given formula in the formula bar section and press the “Enter” key.

Enter the Formula
Enter the Formula

  • Finally, we will get the results in the selected cell.

Result
Result

Conclusion:

🤞 Hope you understand how to test the cell value based on logical functions such as (x OR y) And z in Excel? If you feel this article is useful to you, then leave feedback in the below comment box. Thank you so much for visiting our site!! Click here to know more about *Geek Excel **and Excel Formulas *!! **

Related Articles:

Top comments (0)