Excel Formulas to Test If a Cell Value is (X or Y) and Z!!
Tags: excelformula, excelformulas
Published: 2021-02-20 06:29:52

---
title: Excel Formulas to Test If a Cell Value is (X or Y) and Z!!
published: true
date: 2021-02-20 06:16:58 UTC
tags: ExcelFormula,Excelformulas
canonical_url: https://geekexcel.com/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](https://www.microsoft.com/en-in/microsoft-365/excel)

[![If cell is x or y and z](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/If-cell-is-x-or-y-and-z.png)](https://geekexcel.com/?attachment_id=22022#main)<figcaption id="caption-attachment-22022">If the cell is x or y and z</figcaption>
## Generic Formula:

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

**=[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/)([OR](https://geekexcel.com/use-or-function-in-microsoft-excel-365-in-easy-ways/)(A1=x,A1=y),B1=z),”yes”,”no”)**

## 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 see the below example.

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

![Input Ranges](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/Input-Ranges-18.png)<figcaption id="caption-attachment-22021">Input Ranges</figcaption>

- 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](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/Enter-the-Formula-20.png)<figcaption id="caption-attachment-22023">Enter the Formula</figcaption>

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

![Result](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/Result-23.png)<figcaption id="caption-attachment-22024">Result</figcaption>

## Conclusion:

![🤞](https://s.w.org/images/core/emoji/13.0.1/72x72/1f91e.png) 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](https://geekexcel.com/) **and [**Excel Formulas**](https://geekexcel.com/excel-formula/) **!! **

### Related Articles:

- **[Excel formulas to Find IF Cells Equal to a Certain Value!! ](https://geekexcel.com/excel-formulas-to-find-if-cells-equal-to/)**
- **[Excel Formulas to Lookup Multiple Criteria with INDEX and MATCH!!](https://geekexcel.com/excel-lookup-multiple-criteria-with-index-and-match/)**