DEV Community


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

excelgeek profile image Andrews Originally published at on ・3 min read

On our blog, we have already learned the formula to test if a cell value is X or Y and Z in Excel. In this article, we are going to learn the simple formula to test the cell value with more logical functions like X and (Y or Z) in Excel. Let’s get into this article!! Get an official version of ** MS Excel** from the following link:

If cell value is X and Y or Z
If cell value is X and Y or Z

General Formula:

  • To test the cell value based on logical functions in Excel, use the below formula.


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 consider the below example. Here we will show how to perform the more complex logic functions in Excel.

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

Input Ranges
Input Ranges

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

Enter the formula
Enter the formula

  • Now, the result will be displayed in the selected cell.



From this tutorial, you can get some clarification on how to test the cell value based on logical functions such as X and (Y or Z) in Excel? Please feel free to state your query or feedback for the above article. To learn more, check out *Geek Excel **and Excel Formulas *!! **

Read Ahead:

Discussion (0)

Editor guide