Excel Formulas to Test If a Cell Value is X and (Y or Z)!!
Tags: excelformula, excelformulas
Published: 2021-02-24 11:44:35

---
title: Excel Formulas to Test If a Cell Value is X and (Y or Z)!!
published: true
date: 2021-02-24 11:42:16 UTC
tags: ExcelFormula,Excelformulas
canonical_url: https://geekexcel.com/excel-formulas-to-test-if-a-cell-value-is-x-and-y-or-z/
---

On our blog, we have already learned the **[formula to test if a cell value is X or Y and Z in Excel](https://geekexcel.com/excel-formulas-to-test-if-a-cell-value-is-x-or-y-and-z/)**. 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: [https://www.microsoft.com/en-in/microsoft-365/excel](https://www.microsoft.com/en-in/microsoft-365/excel)

[![If cell value is X and Y or Z](https://geekexcel.com/wp-content/uploads/2021/02/If-cell-value-is-X-and-Y-or-Z.png)](https://geekexcel.com/excel-formulas-to-test-if-a-cell-value-is-x-and-y-or-z/if-cell-value-is-x-and-y-or-z/#main)<figcaption id="caption-attachment-22120">If cell value is X and Y or Z</figcaption>
## General Formula:

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

**=[IF](https://geekexcel.com/use-if-function-in-microsoft-excel-365-simple-steps/)([AND](https://geekexcel.com/how-to-use-logical-function-and-in-excel-365/)(A1=”x”,[OR](https://geekexcel.com/use-or-function-in-microsoft-excel-365-in-easy-ways/)(B1=”y”,B1=”z”)),”x”,””)**

## Syntax Explanations:

- **IF** – In Excel, the **[IF function](https://geekexcel.com/use-if-function-in-microsoft-excel-365-simple-steps/)** helps to return one value for a **[TRUE](https://geekexcel.com/use-true-function-in-microsoft-excel-365-simple-methods/)** result, and another for a **[FALSE](https://geekexcel.com/use-false-function-in-microsoft-excel-365-simple-methods/)** result.
- **AND** – The [**AND Function**](https://geekexcel.com/how-to-use-logical-function-and-in-excel-365/) checks multiple Conditions and returns **[TRUE](https://geekexcel.com/use-true-function-in-microsoft-excel-365-simple-methods/) **if all the conditions are evaluated as true otherwise returns [**FALSE**](https://geekexcel.com/use-false-function-in-microsoft-excel-365-simple-methods/).
- **OR** – It is a logical function to test multiple conditions at the same time. The **[OR Function](https://geekexcel.com/use-or-function-in-microsoft-excel-365-in-easy-ways/)** helps to return either **[TRUE](https://geekexcel.com/use-true-function-in-microsoft-excel-365-simple-methods/)** or **[FALSE](https://geekexcel.com/use-false-function-in-microsoft-excel-365-simple-methods/)**.
- **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](https://geekexcel.com/wp-content/uploads/2021/02/Input-Ranges-23.png)<figcaption id="caption-attachment-22121">Input Ranges</figcaption>

- Here, we are going to select the candidates based on their course and grades.
- Apply the above-given formula in the [**formula bar**](https://geekexcel.com/how-to-use-formula-bar-for-various-purpose-in-excel-365/) section and press the **“Enter”** key.

![Enter the formula](https://geekexcel.com/wp-content/uploads/2021/02/Enter-the-formula-25.png)<figcaption id="caption-attachment-22122">Enter the formula</figcaption>

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

[![Result](https://geekexcel.com/wp-content/uploads/2021/02/Result-28.png)](https://geekexcel.com/excel-formulas-to-test-if-a-cell-value-is-x-and-y-or-z/result-189/#main)<figcaption id="caption-attachment-22123">Result</figcaption>

## Wrap-Up:

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](https://geekexcel.com/) **and [**Excel Formulas**](https://geekexcel.com/excel-formula/) **!! **

### Read Ahead:

- **[Excel Formulas to Test Multiple Cells and Return Non-Blank Value!!](https://geekexcel.com/excel-formulas-multiple-cells-and-return-non-blank-value/)**
- **[Excel Formulas to Check If the Cell Value is NOT This or That!!](https://geekexcel.com/excel-formulas-to-check-if-the-cell-value-is-not-this-or-that/)**